| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part
of the API and documentation update from 'instantiation' as the term for
macros to 'expansion'.
llvm-svn: 135914
|
|
|
|
|
|
| |
Mulder!
llvm-svn: 135855
|
|
|
|
|
|
|
|
| |
LLVM.h imports
them into the clang namespace.
llvm-svn: 135852
|
|
|
|
| |
llvm-svn: 135675
|
|
|
|
|
|
| |
(good call!).
llvm-svn: 135510
|
|
|
|
|
|
|
|
| |
arch-pc-win32-macho (e.g., x86_64-pc-win32-macho), which appears to be a false
positive.
rdar://9786307
llvm-svn: 135502
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
source locations from source locations loaded from an AST/PCH file.
Previously, loading an AST/PCH file involved carefully pre-allocating
space at the beginning of the source manager for the source locations
and FileIDs that correspond to the prefix, and then appending the
source locations/FileIDs used for parsing the remaining translation
unit. This design forced us into loading PCH files early, as a prefix,
whic has become a rather significant limitation.
This patch splits the SourceManager space into two parts: for source
location "addresses", the lower values (growing upward) are used to
describe parsed code, while upper values (growing downward) are used
for source locations loaded from AST/PCH files. Similarly, positive
FileIDs are used to describe parsed code while negative FileIDs are
used to file/macro locations loaded from AST/PCH files. As a result,
we can load PCH/AST files even during parsing, making various
improvemnts in the future possible, e.g., teaching #include <foo.h> to
look for and load <foo.h.gch> if it happens to be already available.
This patch was originally written by Sebastian Redl, then brought
forward to the modern age by Jonathan Turner, and finally
polished/finished by me to be committed.
llvm-svn: 135484
|
|
|
|
| |
llvm-svn: 135170
|
|
|
|
| |
llvm-svn: 135166
|
|
|
|
|
|
|
|
|
| |
-mavx is
specified, 128 avx code is used and we're not sure yet if this the behavior
we want (and if it does, some improvements are needed before relying on it).
llvm-svn: 134939
|
|
|
|
| |
llvm-svn: 134935
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When two different types has the same text representation in the same
diagnostic message, print an a.k.a. after the type if the a.k.a. gives extra
information about the type.
class versa_string;
typedef versa_string string;
namespace std {template <typename T> class vector;}
using std::vector;
void f(vector<string> v);
namespace std {
class basic_string;
typedef basic_string string;
template <typename T> class vector {};
void g() {
vector<string> v;
f(v);
}
}
Old message:
----------------
test.cc:15:3: error: no matching function for call to 'f'
f(&v);
^
test.cc:7:6: note: candidate function not viable: no known conversion from
'vector<string>' to 'vector<string>' for 1st argument
void f(vector<string> v);
^
1 error generated.
New message:
---------------
test.cc:15:3: error: no matching function for call to 'f'
f(v);
^
test.cc:7:6: note: candidate function not viable: no known conversion from
'vector<string>' (aka 'std::vector<std::basic_string>') to
'vector<string>' (aka 'std::vector<versa_string>') for 1st argument
void f(vector<string> v);
^
1 error generated.
llvm-svn: 134904
|
|
|
|
|
|
|
|
|
|
|
|
| |
should not imply -mno-sse.
Note that because we don't usually touch the MMX registers anyway, all -mno-mmx needs to do is tweak the x86-32 calling convention a little for vectors that look like MMX vectors, and prevent the definition of __MMX__.
clang doesn't actually stop the user from using MMX inline asm operands or MMX builtins in -mno-mmx mode; as a QOI issue, it would be nice to diagnose, but I doubt it really matters much.
<rdar://problem/9694837>
llvm-svn: 134770
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
change.
Previously clang was passing the following feature strings to the ARM backend
when CPU is cortex-a8: +neon,-vfp2,-vfp3
This used to work because -vfp2,-vfp3 had no effect after +neon. Now that the
features are controlled by individual bits (with implied hierarchy), the net
effect is all three features will be turned off.
llvm-svn: 134691
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
instantiation and improve diagnostics which are stem from macro
arguments to trace the argument itself back through the layers of macro
expansion.
This requires some tricky handling of the source locations, as the
argument appears to be expanded in the opposite direction from the
surrounding macro. This patch provides helper routines that encapsulate
the logic and explain the reasoning behind how we step through macros
during diagnostic printing.
This fixes the rest of the test cases originially in PR9279, and later
split out into PR10214 and PR10215.
There is still some more work we can do here to improve the macro
backtrace, but those will follow as separate patches.
llvm-svn: 134660
|
|
|
|
|
|
| |
Fixes PR10299 and rdar://9740322
llvm-svn: 134654
|
|
|
|
|
|
| |
Lexer, since they depend on it now.
llvm-svn: 134644
|
|
|
|
| |
llvm-svn: 134619
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
diagnostics.
When a macro instantiation occurs, reserve a SLocEntry chunk with length the
full length of the macro definition source. Set the spelling location of this chunk
to point to the start of the macro definition and any tokens that are lexed directly
from the macro definition will get a location from this chunk with the appropriate offset.
For any tokens that come from argument expansion, '##' paste operator, etc. have their
instantiation location point at the appropriate place in the instantiated macro definition
(the argument identifier and the '##' token respectively).
This improves macro instantiation diagnostics:
Before:
t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int')
int y = M(/);
^~~~
t.c:5:11: note: instantiated from:
int y = M(/);
^
After:
t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int')
int y = M(/);
^~~~
t.c:3:20: note: instantiated from:
\#define M(op) (foo op 3);
~~~ ^ ~
t.c:5:11: note: instantiated from:
int y = M(/);
^
The memory savings for a candidate boost library that abuses the preprocessor are:
- 32% less SLocEntries (37M -> 25M)
- 30% reduction in PCH file size (900M -> 635M)
- 50% reduction in memory usage for the SLocEntry table (1.6G -> 800M)
llvm-svn: 134587
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It would add up relative (decomposed) offsets like in getDecomposedSpellingLocSlowCase, but while
it makes sense to preserve the offset among lexed spelling locations, it doesn't make
sense to add anything to the offset of the instantiation location. The instantiation
location will be the same regardless of the relative offset in the tokens that were
instantiated.
This bug didn't actually affect anything because, currently, in practice we never create macro
locations with relative offset greater than 0.
llvm-svn: 134586
|
|
|
|
| |
llvm-svn: 134585
|
|
|
|
|
|
|
| |
clang_saveTranslationUnit() to save a PCH file if the only errors it
contains are recoverable errors. Fixes <rdar://problem/9727804>.
llvm-svn: 134503
|
|
|
|
|
|
|
| |
The small number of elements was determined by taking the median
file length in clang+llvm and /usr/include on OS X with xcode installed.
llvm-svn: 134496
|
|
|
|
| |
llvm-svn: 134490
|
|
|
|
|
|
|
| |
passed to it, and unknown selectors causing potential leak.
// rdar://9659270
llvm-svn: 134449
|
|
|
|
| |
llvm-svn: 134443
|
|
|
|
| |
llvm-svn: 134425
|
|
|
|
| |
llvm-svn: 134422
|
|
|
|
| |
llvm-svn: 134411
|
|
|
|
| |
llvm-svn: 134410
|
|
|
|
| |
llvm-svn: 134399
|
|
|
|
| |
llvm-svn: 134393
|
|
|
|
| |
llvm-svn: 134392
|
|
|
|
|
|
| |
Fixes rdar://9714064
llvm-svn: 134292
|
|
|
|
| |
llvm-svn: 134283
|
|
|
|
| |
llvm-svn: 134070
|
|
|
|
|
|
| |
Fixes rdar://9281377
llvm-svn: 134016
|
|
|
|
|
|
|
|
| |
location
is at the first token but that the location's offset is not inside the token as well.
llvm-svn: 133800
|
|
|
|
|
|
| |
use the deprecated forms of llvm::StringMap::GetOrCreateValue().
llvm-svn: 133515
|
|
|
|
|
|
|
|
| |
register aliases. Fixes unnecessary renames of clobbers.
Fixes part of rdar://9425559
llvm-svn: 133485
|
|
|
|
|
|
| |
__bridge_retain as a synonym for __bridge_retained.
llvm-svn: 133295
|
|
|
|
|
|
| |
Part of rdar://9197685
llvm-svn: 133225
|
|
|
|
|
|
|
|
| |
constraints.
rdar://9618597
llvm-svn: 133222
|
|
|
|
| |
llvm-svn: 133181
|
|
|
|
|
|
| |
them only on Darwin tool chains.
llvm-svn: 133112
|
|
|
|
|
|
|
|
|
|
| |
Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.
Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.
llvm-svn: 133103
|
|
|
|
|
|
| |
Depends on LLVM r133093.
llvm-svn: 133094
|
|
|
|
| |
llvm-svn: 132990
|
|
|
|
| |
llvm-svn: 132924
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:
t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
expression of type 'NSArray *' [-Wincompatible-pointer-types]
NSSet *array = [[NSArray alloc] init];
^ ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note:
instance method 'init' is assumed to return an instance of its
receiver
type ('NSArray *')
- (id)init;
^
It also means that we get decent type inference when writing code in
Objective-C++0x:
auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil];
// ^ now infers NSMutableArray* rather than id
llvm-svn: 132868
|