Because in CUDA types do not have associated address spaces,
globals are declared in their "native" address space, and accessed
by bitcasting the pointer to address space 0. This relies on address
space 0 being a unified address space.
llvm-svn: 157167
that bridging between the two is free. Saves ~4k of code size,
although I don't see any measurable performance difference
(unfortunately).
llvm-svn: 156187
validate that we didn't override the contents of any of such files.
If this is detected, emit a diagnostic error and recover gracefully
by using the contents of the original file that the PCH was built from.
Part of rdar://11305263
llvm-svn: 156107
r155047. See the LLVM log for the primary motivation:
http://llvm.org/viewvc/llvm-project?rev=155047&view=rev
Primary commit r154828:
- Several issues were raised in review, and fixed in subsequent
commits.
- Follow-up commits also reverted, and which should be folded into the
original before reposting:
- r154837: Re-add the 'undef BUILTIN' thing to fix the build.
- r154928: Fix build warnings, re-add (and correct) header and
license
- r154937: Typo fix.
Please resubmit this patch with the relevant LLVM resubmission.
llvm-svn: 155048
This method is very hot, it is called when emitting diagnostics, in -E mode
and for many #pragma handlers. It scans through the whole source file to
count newlines, records and caches them in a vector.
The speedup from vectorization isn't very large, as we fall back to bytewise
scanning when we hit a newline. There might be a way to avoid leaving the sse
loop but everything I tried didn't work out because a call to push_back
clobbers xmm registers.
About 2% speedup on average on "clang -E > /dev/null" of all .cpp files in
clang's lib/Sema.
llvm-svn: 154204
uses Neon instructions for single-precision FP.
-mfpmath=neon is analogous to passing llc -mattr=+neonfp.
-mfpmath=[vfp|vfp2|vfp3|vfp4] is analogous to passing llc -mattr=-neonfp.
rdar://11108618
llvm-svn: 154046
- This is much more important than it appears at first glance...
The intended design of DiagnosticBuilder was that it never escape and that all
its members would get lowered to registers by the compiler. By fixing Emit here,
the compiler can completely eliminate the DiagnosticBuilder object and never
need to push those registers back into it.
Unfortunately, Sema has broken DiagnosticBuilder in other ways (by introducing
SemaDiagnosticBuilder), so we don't get the fill impact of this, but it is still
good for 30k reduction in code size. I'll work on fixing the
SemaDiagnosticBuilder problems next.
llvm-svn: 152669
by ~%.3/~100k in my build -- simply by eliminating the horrible code bloat coming
from the .clear() of the SmallVector<FixItHint>, which does a std::~string, etc.
- My understanding is we don't ever emit arbitrary numbers of fixits, so I just
moved us to using a statically sized array like we do for arguments and
ranges.
llvm-svn: 152639
first codepoint! Also, don't reject empty raw string literals for spurious
"encoding" issues. Also, don't rely on undefined behavior in ConvertUTF.c.
llvm-svn: 152344
If you're using git-svn, the clang and llvm repository will typically
map to a different revision.
Before we had:
clang version 3.1 (trunk 152167 trunk 152162)
After this change:
clang version 3.1 (trunk 152167) (llvm/trunk 152162)
So it's self-descriptive with an extra parens group. Which is more
compatible with version string parsers is probably debatable, but this
style was requested.
llvm-svn: 152183
the new Objective-C NSArray/NSDictionary/NSNumber literal syntax.
This introduces a new library, libEdit, which provides a new way to support
migration of code that improves on the original ARC migrator. We now believe
that most of its functionality can be refactored into the existing libraries,
and thus this new library may shortly disappear.
llvm-svn: 152141
ptrdiff_t on PPC32 on Linux, etc. should be int not long.
This does not matter for C, but it does matter for C++ because of
name mangling.
The preprocessor test has been changed accordingly.
llvm-svn: 151935
Unconditionally define __C99FEATURES__ when using C++ on Solaris. This is a
(hopefully temporary) work around for libc++ exposing C99-but-not-C++98
features in C++98 mode.
llvm-svn: 151889
IndentifierTable::get() and into IdentifierTable's constructor.
This gets a 0.7% reducing on lexing time for Cocoa.h, and
about the same for PCH generation.
llvm-svn: 151854
from the one stored in the PCH/AST, while trying to load a SLocEntry.
We verify that all files of the PCH did not change before loading it but this is not enough because:
- The AST may have been 1) kept around, 2) to do queries on it.
- We may have 1) verified the PCH and 2) started parsing.
Between 1) and 2) files may change and we are going to have crashes because the rest of clang
cannot deal with the ASTReader failing to read a SLocEntry.
Handle this by recovering gracefully in such a case, by initializing the SLocEntry
with the info from the PCH/AST as well as reporting failure by the ASTReader.
rdar://10888929
llvm-svn: 151004
This option was added in r129614 and doesn't have any use case that I'm aware
of. It's possible that external tools are using these names - and if that's
the case we can certainly reassess the functionality, but for now it lets us
shave out a few unneeded bits from clang.
Move the "StaticDiagNameIndex" table into the only remaining consumer, diagtool.
This removes the actual diagnostic name strings from clang entirely.
Reviewed by Chris Lattner & Ted Kremenek.
llvm-svn: 150612
This seems to negatively affect compile time onsome ObjC tests
(which use a lot of partial diagnostics I assume). I have to come
up with a way to keep them inline without including Diagnostic.h
everywhere. Now adding a new diagnostic requires a full rebuild
of e.g. the static analyzer which doesn't even use those diagnostics.
This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99.
This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789.
This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7.
This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f.
This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5.
llvm-svn: 150006
MAP_ERROR to be remapped to MAP_WARNING. These new APIs are being added to
allow the diagnostic mapping's "no Werror" bit to be set, and potentially
downgrade anything already mapped to be a warning.
llvm-svn: 150001
Let ASTContext allocate the storage in its BumpPtrAllocator.
This will help us remove ASTContext's depedency on PartialDiagnostic.h soon.
llvm-svn: 149780
into using non-absolute system includes (<foo>)...
... and introduce another hack that is simultaneously more heineous
and more effective. We whitelist Clang-supplied headers that augment
or override system headers (such as float.h, stdarg.h, and
tgmath.h). For these headers, Clang does not provide a module
mapping. Instead, a system-supplied module map can refer to these
headers in a system module, and Clang will look both in its own
include directory and wherever the system-supplied module map
suggests, then adds either or both headers. The end result is that
Clang-supplied headers get merged into the system-supplied module for
the C standard library.
As a drive-by, fix up a few dependencies in the _Builtin_instrinsics
module.
llvm-svn: 149611
each of the targets. Use this for module requirements, so that we can
pin the availability of certain modules to certain target features,
e.g., provide a module for xmmintrin.h only when SSE support is
available.
Use these feature names to provide a nearly-complete module map for
Clang's built-in headers. Only mm_alloc.h and unwind.h are missing,
and those two are fairly specialized at the moment. Finishes
<rdar://problem/10710060>.
llvm-svn: 149227
like Darwin that don't support it. We should also complain about
invalid -fvisibility=protected, but that information doesn't seem
to exist at the most appropriate time, so I've left a FIXME behind.
llvm-svn: 149186
single attribute ("system") that allows us to mark a module as being a
"system" module. Each of the headers that makes up a system module is
considered to be a system header, so that we (for example) suppress
warnings there.
If a module is being inferred for a framework, and that framework
directory is within a system frameworks directory, infer it as a
system framework.
llvm-svn: 149143
-Wno-everything remap all warnings to ignored.
We can now use "-Wno-everything -W<warning>" to ignore all warnings except
specific ones.
llvm-svn: 149121
ARM supports clz and ctz directly and both operations have well-defined
results for zero. There is no disadvantage in performance to using the
defined-at-zero versions of llvm.ctlz/cttz intrinsics. We're running into
ARM-specific code written with the assumption that __builtin_clz(0) == 32,
even though that value is technically undefined. The code is failing now
because of llvm optimizations that are taking advantage of the undef
behavior (specifically svn r147255). There's nothing wrong with that
optimization on x86 where any incorrect assumptions about __builtin_clz(0)
will quickly be exposed. For ARM, though, optimizations based on that undef
behavior are likely to cause subtle bugs. Other targets with defined-at-zero
clz/ctz support may want to override the default behavior as well.
llvm-svn: 149086
Patch from Jyotsna Verma:
I have made the changes to remove assertions in the Hexagon backend
specific clang driver. Instead of asserting on invalid arch name, it has
been modified to use the default value.
I have changed the implementation of the CPU flag validation for the
Hexagon backend. Earlier, the clang driver performed the check and
asserted on invalid inputs. In the new implementation, the driver passes
the last CPU flag (or sets to "v4" if not specified) to the compiler (and
also to the assembler and linker which perform their own check) instead of
asserting on incorrect values. This patch changes the setCPU function for
the Hexagon backend in clang/lib/Basic/Targets.cpp which causes the
compiler to error out on incorrect CPU flag values.
llvm-svn: 148139
- Support gcc-compatible vfpv3 name in addition to vfp3.
- Support vfpv3-d16.
- Disable neon feature for -mfpu=vfp* (yes, we were emitting Neon instructions
for those!).
llvm-svn: 147943
in the module map. This provides a bit more predictability for the
user, as well as eliminating the need to sort the submodules when
serializing them.
llvm-svn: 147564
modules. This leaves us without an explicit syntax for importing
modules in C/C++, because such a syntax needs to be discussed
first. In Objective-C/Objective-C++, the @import syntax is used to
import modules.
Note that, under -fmodules, C/C++ programs can import modules via the
#include mechanism when a module map is in place for that header. This
allows us to work with modules in C/C++ without committing to a syntax.
llvm-svn: 147467
features needed for a particular module to be available. This allows
mixed-language modules, where certain headers only work under some
language variants (e.g., in C++, std.tuple might only be available in
C++11 mode).
llvm-svn: 147387