Larisse Voufo [Sat, 14 Feb 2015 05:42:57 +0000 (05:42 +0000)]
Revise the implementation logic of sized deallocation: Do not automatically generate weak definitions of the sized operator delete (in terms of unsized operator delete). Instead, provide the funcitonality via a new compiler flag, -fdef-sized-delete.
The current implementation causes link-time ODR violations when the delete symbols are exported into the dynamic table.
Richard Smith [Sat, 14 Feb 2015 01:52:20 +0000 (01:52 +0000)]
DR1748: the reserved placement allocation functions have undefined behavior if
they're given a null pointer as an argument, so we do not need to emit null
checks on their results.
David Blaikie [Sat, 14 Feb 2015 00:41:07 +0000 (00:41 +0000)]
Update test case to be compatible with auto-migration to new getelementptr syntax coming in the near future
The first change won't touch GEPOperators such as these, but the update
script only identifies them by the leading '(' after getelementptr or
'getelementptr inbounds', so update this test to at least have those
features to allow auto-migrating.
Richard Smith [Fri, 13 Feb 2015 23:50:20 +0000 (23:50 +0000)]
[modules] If we have a choice between including a file textually and importing
a prebuilt form from a module, prefer the modular form, all else being equal.
Richard Smith [Fri, 13 Feb 2015 22:43:51 +0000 (22:43 +0000)]
[modules] Guard against recursively re-entering diagnosing ODR violations while
in the middle of emitting an ODR violation diagnostic. I don't yet have a
reduced testcase for this issue, working on it...
Chandler Carruth [Fri, 13 Feb 2015 09:47:49 +0000 (09:47 +0000)]
[PM] Move away from the old llvm/PassManager.h header and its using
declarations and just use the legacy namespace qualifier in this file
and the permanent header name.
The old wrapper header is going away to make LLVM's build more modular,
and without updating Clang I can't easily start to add usage of the new
pass manager to Clang. This should make it more clear in the code which
set of types is doing what.
David Majnemer [Fri, 13 Feb 2015 07:55:47 +0000 (07:55 +0000)]
MS ABI: Implement /volatile:ms
The /volatile:ms semantics turn volatile loads and stores into atomic
acquire and release operations. This distinction is important because
volatile memory operations do not form a happens-before relationship
with non-atomic memory. This means that a volatile store is not
sufficient for implementing a mutex unlock routine.
Craig Topper [Fri, 13 Feb 2015 06:27:39 +0000 (06:27 +0000)]
[X86] Fix test cases that I foolishly copied and modified from another file that had optimizations on. This caused the check patterns to not quite match.
Richard Smith [Thu, 12 Feb 2015 23:21:45 +0000 (23:21 +0000)]
[modules] When collecting declarations to complete a redeclaration chain for an
entity, put the originally-canonical decl IDs in the right places in the redecl
chain rather than reordering them all to the start. If we don't ensure that the
redecl chain order is consistent with the topological module order, we can fail
to make a declaration visible if later declarations are in more IDNSs than
earlier ones (for instance, because the earlier decls are invisible friends).
Ben Langmuir [Thu, 12 Feb 2015 21:51:31 +0000 (21:51 +0000)]
Mangle the IsSystem bit into the .pcm file name
When mangling the module map path into a .pcm file name, also mangle the
IsSystem bit, which can also depend on the header search paths. For
example, the user may change from -I to -isystem. This can affect
diagnostics in the importing TU.
Greg Bedwell [Thu, 12 Feb 2015 12:41:28 +0000 (12:41 +0000)]
Fix dependency generation crash test to run clang and clean up after itself.
Previously the test did not have a RUN: prefix for the clang command.
In addition it was leaving behind a tmp file with no permissions causing issues when
deleting the build directory on Windows.
[mips] Partially revert r223927: Removing __SIZEOF_INT128__ macro for MIPS64
Partially revert r223927 because LLVM gained support for 128-bit integers
in r227089. Modify and keep the tests that verify the definition of the
macro __SIZEOF_INT128__ for MIPS64 BE & LE in the preprocessor.
If the linker is gcc (the default for Generic_ELF toolchains), we end up
passing most of the arguments to the linker.
Some tests were failing to account for this in their usage of *-NOT: lines
and would fail if compiled with
-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-unknown
Steven Wu [Thu, 12 Feb 2015 02:06:55 +0000 (02:06 +0000)]
Add InlineAsmDiagnosticHandler for bitcode input
Summary:
This patch installs an InlineAsmDiagnosticsHandler to avoid the crash
report when the input is bitcode and the bitcode contains invalid inline
assembly. The handler will simply print the same error message that will
print from the backend.
Richard Smith [Thu, 12 Feb 2015 01:55:09 +0000 (01:55 +0000)]
More for DR1467: In C++, when initializing an element of an aggregate,
always use the normal copy-initialization rules. Remove a special case that
tries to stay within the list initialization checker here; that makes us do the
wrong thing when list-initialization of an aggregate would not perform
aggregate initialization.
Richard Smith [Thu, 12 Feb 2015 01:50:05 +0000 (01:50 +0000)]
Improve the "braces around scalar init" warning to determine whether to warn
based on whether "redundant" braces are ever reasonable as part of the
initialization of the entity, rather than whether the initialization is
"top-level". In passing, add a warning flag for it.
Adrian Prantl [Wed, 11 Feb 2015 17:45:15 +0000 (17:45 +0000)]
Fix PR19351. While building up a composite type it is important to use
a non-uniqueable temporary node that is only turned into a permanent
unique or distinct node after it is finished.
Otherwise an intermediate node may get accidentally uniqued with another
node as illustrated by the testcase.
Justin Bogner [Wed, 11 Feb 2015 02:53:03 +0000 (02:53 +0000)]
InstrProf: Add a test for PR22531
This is a test for the llvm change in r228793. We need to make sure
that names referred to by coverage end up in the right section, or the
coverage tools won't work.
Richard Smith [Wed, 11 Feb 2015 02:41:33 +0000 (02:41 +0000)]
Add a warning for direct-list-initialization of a variable with a deduced type
(or of a lambda init-capture, which is sort-of such a variable). The semantics
of such constructs will change when we implement N3922, so we intend to warn on
this in Clang 3.6 then change the semantics in Clang 3.7.
Anton Yartsev [Tue, 10 Feb 2015 20:13:08 +0000 (20:13 +0000)]
[analyzer] Pass actual state to alloc/dealloc handling functions.
The state obtained from CheckerContext::getState() may be outdated by the time the alloc/dealloc handling function is called (e.g. the state was modified but the transition was not performed). State argument was added to all alloc/dealloc handling functions in order to get the latest state and to allow sequential calls to those functions.
Bob Wilson [Tue, 10 Feb 2015 06:33:04 +0000 (06:33 +0000)]
Do not force "-static" for aarch64 iOS kernel/kext assembly code.
Somehow a check for aarch64 was added to the Darwin toolchain's
isKernelStatic function as part of the initial commit for Apple's
arm64 target (r205100). That check was not in any of Apple's internal
code and no one here knows where it came from. It has been harmless
because "-static" does not change much, if anything, for arm64 iOS code,
but it makes no sense to keep this check.
Richard Smith [Tue, 10 Feb 2015 03:28:10 +0000 (03:28 +0000)]
[modules] When determining whether a name from a module replaces a name we
already have, check whether the name from the module is actually newer than the
existing declaration. If it isn't, we might (say) replace a visible declaration
with an injected friend, and thus make it invisible (or lose a default argument
or an array bound).
Gabor Horvath [Mon, 9 Feb 2015 22:52:26 +0000 (22:52 +0000)]
[Static Analyzer] The name of the checker that reports a bug is added
to the plist output. This check_name field does not guaranteed to be the
same as the name of the checker in the future.
Ben Langmuir [Mon, 9 Feb 2015 21:55:44 +0000 (21:55 +0000)]
Be more conservative about gethostname()'s truncating behaviour
Don't assume it will provide an error or null-terminate the string on
truncation, since POSIX doesn't guarantee either behaviour (although
Linux and Darwin at least will do the 'right thing').
Ben Langmuir [Mon, 9 Feb 2015 20:35:13 +0000 (20:35 +0000)]
Diagnose timeouts in the LockFileManager and delete the dead lock file
If the lock file manager times out, we should give an error rather than
silently trying to load the existing module. And delete the
(presumably) dead lock file, since it will otherwise prevent progress in
future invokations. This is unsound since we have no way to prove that
the lock file we are deleting is the same one we timed out on, but since
the lock is only to avoid excessive rebuilding anyway it should be okay.
Depends on llvm r228603.
Ben Langmuir [Mon, 9 Feb 2015 20:13:11 +0000 (20:13 +0000)]
Update r228592 for when gethostname() returns an error
If gethostname() is not successful, just skip adding the hostname to the
module hash. And don't bother setting hostname[255] = 0, since if
gethostname() is successful, it will be null-terminated already (and if
it's not successful we don't read the string now.
Benjamin Kramer [Mon, 9 Feb 2015 11:48:43 +0000 (11:48 +0000)]
Update cxx_status to list features implemented in Clang 3.6.
Still yellow because 3.6 is unreleased. While there make Urbana paper
links clickable and list binary literals as available in Clang 2.9
(they've been available basically since the dawn of Clang, but not
having a version number in the table looks weird)
Benjamin Kramer [Sat, 7 Feb 2015 13:15:54 +0000 (13:15 +0000)]
CodeGen: Move DebugLocs.
It's slightly cheaper than copying it, if the DebugLoc points to replaceable
metadata every copy is recorded in a DenseMap, moving reduces the peak size of
that map.
Richard Smith [Sat, 7 Feb 2015 03:11:11 +0000 (03:11 +0000)]
[modules] Treat friend declarations that are lexically within a dependent
context as anonymous for merging purposes. They can't be found by their names,
so we merge them based on their position within the surrounding context.
Nico Weber [Sat, 7 Feb 2015 01:57:32 +0000 (01:57 +0000)]
clang-format: Format Objective-C try blocks like all the other try blocks.
Before:
@try {
// ...
}
@finally {
// ...
}
Now:
@try {
// ...
} @finally {
// ...
}
This is consistent with how we format C++ try blocks and SEH try blocks.
clang-format not doing this before was an implementation oversight.
This is dependent on BraceBreakingStyle. The snippet above is with the
Attach style. Style Stroustrip for example still results in the "Before:"
snippet, which makes sense since other blocks (try, else) break after '}' too.
Inline asm IR input register constraints don't have early clobber
modifiers on them. If we have a matching output constraint with
an early clobber make sure we don't propagate that to the input
constraint.
Steven Wu [Fri, 6 Feb 2015 18:08:29 +0000 (18:08 +0000)]
-iframework option should be forwarded to linker
Summary:
-iframework option is used to specified System framework path so the
path specified should be passed to linker as -F option
rdar://problem/18234544
Ben Langmuir [Fri, 6 Feb 2015 17:34:28 +0000 (17:34 +0000)]
Make FileEntry::closeFile public
If you request that the file manager not close your file immediately
after reading, it's useful to be able to close it later to prevent a
file descriptor leak.
OpenCL: handle shift operator with vector operands
Introduce a number of checks:
1. If LHS is a scalar, then RHS cannot be a vector.
2. Operands must be of integer type.
3. If both are vectors, then the number of elements must match.
Relax the requirement for "usual arithmetic conversions":
When LHS is a vector, a scalar RHS can simply be expanded into a
vector; OpenCL does not require that its rank be lower than the LHS.
For example, the following code is not an error even if the implicit
type of the constant literal is "int".
char2 foo(char2 v) { return v << 1; }
Consolidate existing tests under CodeGenOpenCL, and add more tests
under SemaOpenCL.
Richard Smith [Fri, 6 Feb 2015 02:42:59 +0000 (02:42 +0000)]
[modules] If a module declares an entity and then imports another declaration
of that entity, ensure that the redeclaration chain is reordered properly on
reload. Otherwise, the result of name lookup for that entity may point to an
entity that is too old; if that's an injected friend name or the like, that
can result in the name not being found at all.
Tim Northover [Fri, 6 Feb 2015 01:25:07 +0000 (01:25 +0000)]
Preprocessor: support __BIGGEST_ALIGNMENT__ macro
For compatibility with GCC (and because it's generally helpful information
otherwise inaccessible to the preprocessor). This appears to be canonically the
alignment of max_align_t (e.g. on i386, __BIGGEST_ALIGNMENT__ is 4 even though
vector types will be given greater alignment).