CodeGen: Unify handling guard variables in the Itanium C++ ABI
We previously treated ARM separately from the generic Itanium ABI for
initializing guard variables. This code duplication led to things like
the ARM path missing the memory barrier for threadsafe handling, and a
highly misleading comment about how we were (mis)using the generic ABI
for ARM64 when really it went through the ARM codepath.
This unifies the two code paths. Functionally, this changes the ARM
and ARM64 codepath to use one byte loads instead of 4 and 8,
respectively, and adds the missing atomic acquire to these loads.
Other architectures are unchanged.
Users are expected to pass system includes through the INCLUDE
environment variable on Windows. There's no reason to change behavior
based on the toolchain used to build Clang.
I didn't change the registry searching code because I'm not sure it
builds with mingw and I'm not set up to test it.
Richard Smith [Tue, 22 Apr 2014 23:50:25 +0000 (23:50 +0000)]
Add some missing checks for C++1y digit separators that don't in fact separate
digits. Turns out we have completely separate lexing codepaths for floating
point numbers depending on whether or not they start with a zero. Who knew...
=)
Objective-C ARC. Under ARC, addition of 'bridge' attribute
on CF type is not sufficient and bridge casting is
still required for proper ownership semantics.
// rdar://16650445
Ben Langmuir [Tue, 22 Apr 2014 17:40:12 +0000 (17:40 +0000)]
Attempt to fix null ASTContext in ASTUnit error path
We don't need the ASTContext for the diagnostics, only the language
options, which we can get from the compiler invocation. It worries me
how many categorically different states the ASTUnit class can be in
depending on how it is being constructed/used.
Try to fix warnings to escape '@' as '\@'. [-Wdocumentation-html]
clang/include/clang/Format/Format.h:185:8: error: HTML tag 'tt' requires an end tag [-Werror,-Wdocumentation-html]
/// <tt>@property (readonly)</tt> instead of <tt>@property(readonly)</tt>.
~^~~
Dmitri Gribenko [Tue, 22 Apr 2014 10:59:13 +0000 (10:59 +0000)]
Comment parsing: in the generated XML file, mark HTML that is safe to pass
through to the output even if the input comment comes from an untrusted source
Attribute filtering is currently based on a blacklist, which right now includes
all event handler attributes (they contain JavaScipt code). It should be
switched to a whitelist, but going over all of the HTML5 spec requires a
significant amount of time.
[Modules] Fix potential ODR violations by sinking the DEBUG_TYPE
definition below all of the header #include lines, clang edition.
If you want more details about this, you can see some of the commits to
Debug.h in LLVM recently. This is just the clang section of a cleanup
I've done for all uses of DEBUG_TYPE in LLVM.
Richard Smith [Tue, 22 Apr 2014 01:11:06 +0000 (01:11 +0000)]
Move the C++11 ExtWarn for converting a string literal to 'char*' out of
-Wc++11-compat-deprecated-writable-strings. It's neither a C++11 compatibility
warning nor a deprecated feature, it's just ill-formed.
In passing, add that warning to -Wdeprecated, where it belongs.
Diego Novillo [Mon, 21 Apr 2014 23:16:03 +0000 (23:16 +0000)]
Allow adding a value to a flag in diagnostics.
Summary:
This allows callers of Diags.Report() to append a value to the name of
the flag associated with the diagnostic. This is useful in cases like
the -Rpass flag, where we want the diagnostic to show the name of the
pass that matched the pattern. Instead of showing "... [-Rpass]", this
allows us to show "... [-Rpass=passname]".
[Modules] Remove the only use of the DEBUG(...) macro in the compiler
parts of Clang. I don't really have any opinion about whether using that
macro is good or bad, but its odd that this is the only one, and Eric
seemed happy with just nuking it for now.
Bob Wilson [Mon, 21 Apr 2014 01:23:39 +0000 (01:23 +0000)]
ARM64: Do not expand variadic HFA/HVA arguments with the Darwin ABI.
Unlike the standard AAPCS64 ABI, variadic arguments are always passed on the
stack with the Darwin ABI, and this was not being considered when deciding
whether to expand HFA/HVA arguments in a call. An HFA argument with a "float"
base type was being expanded into separate "float" arguments, each of which
was then extended to a double, resulting in a serious mismatch from what is
expected by the va_arg implementation. <rdar://problem/15777067>
Richard Smith [Sat, 19 Apr 2014 03:48:30 +0000 (03:48 +0000)]
When a module completes the definition of a class template specialization imported from another module, emit an update record, rather than using the broken decl rewriting mechanism. If multiple modules do this, merge the definitions together, much as we would if they were separate declarations.
Ben Langmuir [Fri, 18 Apr 2014 23:51:00 +0000 (23:51 +0000)]
Fix a hole with nested unavailable submodules from r206664
If a module doesn't meet a requirement, neither do its submodules. If we
don't propogate that, we might think it's an error to be missing a
header in one of those submodules.
CodeGen: Use LLVM's InstrProfReader in -fprofile-instr-use=
Update clang to use the InstrProfReader from LLVM to read
instrumentation based profile data. This also switches us from the
naive text format to the binary format, since that's what's
implemented in the reader.
Teach users of OnDiskHashTable to define hash_value and offset types
This paves the way to making OnDiskHashTable work with hashes that are
not 32 bits wide and to making OnDiskHashTable work very large hash
tables. The LLVM change to use these types is upcoming.
The frontend option -fno-optimize-sibling-calls resolves to -cc1's
-mdisable-tail-calls, which is passed to the TargetMachine in the
backend. PassManagerBuilder was adding the -tailcallelim pass anyway.
Use a new DisableTailCalls option in PassManagerBuilder to disable tail
calls harder.
Requires the matching commit in LLVM that adds DisableTailCalls.
In preparation for using a binary format for instrumentation based
profiling, explicitly treat the test inputs as text and transform them
before running. This will allow us to leave the checked in files in
human readable format once the instrumentation format is binary.
Making some public members into private members. This also introduces a bit more const-correctness, and now uses some range-based for loops. No functional changes intended.
clang-format.py: Don't omit the first two words from error messages.
This reverts r172072. clang-format used to use DiagnosticEngine to output
errors: http://llvm.org/viewvc/llvm-project?view=revision&revision=172071. Now
it doesn't, so this code is obsolete.
Summary:
This patch ensures that the lines of the block comments retain relative
column offsets. In order to do this WhitespaceManager::Changes representing
continuation of block comments keep a pointer on the change representing the
whitespace change before the block comment, and a relative column offset to this
change, so that the correct column can be reconstructed at the end of alignment
process.
Since the object is new'ed in the enterCFG function, now deleting in the exitCFG function instead of the destructor to ensure proper pairing. This allows reuse of the builder without creating a memory leak.
Tim Northover [Thu, 17 Apr 2014 10:20:38 +0000 (10:20 +0000)]
ARM64: remove holes from *all* HFAs on the stack.
My first attempt to make sure HFAs were contiguous was in the block dealing
with padding registers, which meant it only triggered on the first stack-based
HFA. This should extend it to the rest as well.
Richard Smith [Thu, 17 Apr 2014 03:52:20 +0000 (03:52 +0000)]
PR19340: If we see a declaration of a member of an unspecialized class template
that looks like it might be an explicit specialization, don't recover as an
explicit specialization (bypassing the check that would reject that).
Ben Langmuir [Thu, 17 Apr 2014 03:31:02 +0000 (03:31 +0000)]
When writing YAML in libclang, use yaml::escape instead of write_escaped
The YAMLParser has its own escaped string representation, and does not
handle octal escape sequences. When writing the virtual file system to a
YAML file, use yaml::escape().
Richard Smith [Thu, 17 Apr 2014 02:56:49 +0000 (02:56 +0000)]
Don't emit an ExtWarn on declarations of variable template specializations;
we'll already have issued the relevant diagnostic when we saw the declaration
of the primary template.