| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
| |
This makes us handle static locals in exported/imported functions correctly.
Differential Revision: http://reviews.llvm.org/D4136
llvm-svn: 211173
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compilation pipeline doesn't actually need to know about the high-level
concept of diagnostic mappings, and hiding the final computed level presents
several simplifications and other potential benefits.
The only exceptions are opportunistic checks to see whether expensive code
paths can be avoided for diagnostics that are guaranteed to be ignored at a
certain SourceLocation.
This commit formalizes that invariant by introducing and using
DiagnosticsEngine::isIgnored() in place of individual level checks throughout
lex, parse and sema.
llvm-svn: 211005
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
'sizeof' is a UnaryExprOrTypeTrait, and it can contain either a type or
an expression. This change threads a RecoveryTSI parameter through the
layers between TransformUnaryExprOrTypeTrait the point at which we look
up the type. If lookup finds a single type result after instantiation,
we now build TypeSourceInfo for it just like a normal transformation
would.
This fixes the last error in the hello world ATL app that I've been
working with, and it now links and runs with clang. Please try it and
file bugs!
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4108
llvm-svn: 210855
|
| |
|
|
|
|
| |
This expands the logic from r210141 to cover partial specializations too.
llvm-svn: 210484
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MSVC delays parsing of default arguments until instantiation. If the
default argument is never used, it is never parsed. We don't model
this.
Instead, if lookup of a type name fails in a template argument context,
we form a DependentNameType, which will be looked up at instantiation
time.
This fixes errors about 'CControlWinTraits' in atlwin.h.
Reviewers: rsmith
Differential Revision: http://reviews.llvm.org/D3995
llvm-svn: 210382
|
| |
|
|
|
|
|
|
|
|
| |
This patch adds support for pointer types in global named registers variables.
It'll be lowered as a pair of read/write_register and inttoptr/ptrtoint calls.
Also adds some early checks on types on SemaDecl to avoid the assert.
Tests changed accordingly. (PR19837)
llvm-svn: 210274
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
templates (PR19902)
This allows us to compile the following kind of code, which occurs in MSVC
headers:
template <typename> struct S {
__declspec(dllimport) static int x;
};
template <typename T> int S<T>::x;
The definition works similarly to a dllimport inline function definition and
gets available_externally linkage.
Differential Revision: http://reviews.llvm.org/D3998
llvm-svn: 210141
|
| |
|
|
|
|
|
| |
Redeclarations cannot add a dll attribute and static data members cannot
be defined.
llvm-svn: 209825
|
| |
|
|
| |
llvm-svn: 209812
|
| |
|
|
|
|
| |
takeAs to getAs.
llvm-svn: 209800
|
| |
|
|
|
|
|
| |
in Objective-C container declarations (but not
in their definitions. // rdar://10414277
llvm-svn: 209751
|
| |
|
|
|
|
| |
of supporting it as a "extension" (which serves no purpose). Un-XFAILing the test for mutable specifiers.
llvm-svn: 209635
|
| |
|
|
| |
llvm-svn: 209613
|
| |
|
|
| |
llvm-svn: 209596
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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) :-/
namespace test7 {
typedef struct {
void bar();
void foo() { bar(); }
} A;
}
Differential Revision: http://reviews.llvm.org/D3809
llvm-svn: 209549
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'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.
llvm-svn: 209510
|
| |
|
|
| |
llvm-svn: 209466
|
| |
|
|
| |
llvm-svn: 209449
|
| |
|
|
|
|
|
| |
If we're so keen on saving a dynamic allocation to add the trailing space, we
might as well do it in style.
llvm-svn: 209247
|
| |
|
|
| |
llvm-svn: 209157
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements global named registers in Clang, lowering to the just
created intrinsics in LLVM (@llvm.read/write_register). A new type of LValue
had to be created (Register), which just adds support to carry the metadata
node containing the name of the register. Two new methods to emit loads and
stores interoperate with another to emit the named metadata node.
No guarantees are being made and only non-allocatable global variable named
registers are being supported. Local named register support is unchanged.
llvm-svn: 209149
|
| |
|
|
|
|
|
|
| |
This is a step towards handling these attributes on classes (PR11170).
Differential Revision: http://reviews.llvm.org/D3772
llvm-svn: 208925
|
| |
|
|
|
|
|
| |
elaborated-type-specifier, place it in the correct
context.
llvm-svn: 208799
|
| |
|
|
|
|
|
|
|
| |
resolves to an existing declaration if there are attributes
present.
This gives us something to apply the attributes to.
llvm-svn: 208756
|
| |
|
|
|
|
| |
implied by 'constexpr'.
llvm-svn: 208511
|
| |
|
|
|
|
|
|
| |
Also correct argument/parameter terminology.
No change in functionality.
llvm-svn: 208498
|
| |
|
|
|
|
|
|
|
|
| |
This lets us diagnose and perform more complete semantic analysis when faced
with errors in the function body or declaration.
By recovering here we provide more consistent diagnostics, particularly during
interactive editing.
llvm-svn: 208394
|
| |
|
|
|
|
|
| |
whether the definition of the template is visible rather than checking whether
the instantiated definition happens to be in an imported module.
llvm-svn: 208150
|
| |
|
|
|
|
|
|
| |
Ideally, importing Foo.a from Foo.b would "do the right thing", but
until it does, this patch makes it an error rather than allow it to
silently be ignored.
llvm-svn: 207948
|
| |
|
|
|
|
|
|
|
|
| |
* Fixes a "return" that was indented at the same level as the continuation
from the previous line
* Wrap several lines to 80 columns
* Remove an if check that was always true
* Move a variable declaration slightly closer to its use
llvm-svn: 207922
|
| |
|
|
| |
llvm-svn: 207896
|
| |
|
|
|
|
|
|
| |
apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal.
Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith.
llvm-svn: 207890
|
| |
|
|
|
|
|
|
|
|
| |
We were emitting dynamic initializers for __thread variables if there
was no explicit initializer, as in this test case:
struct S { S(); };
__thread S s;
llvm-svn: 207675
|
| |
|
|
|
|
|
|
| |
Patch by Dinesh Dwivedi!
Differential Revision: http://reviews.llvm.org/D3376
llvm-svn: 207672
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
A reference temporary should inherit the linkage of the variable it
initializes. Otherwise, we may hit cases where a reference temporary
wouldn't have the same value in all translation units.
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D3515
llvm-svn: 207451
|
| |
|
|
|
|
| |
partial specialization.
llvm-svn: 207260
|
| |
|
|
|
|
| |
symbols in non-imported modules.
llvm-svn: 206977
|
| |
|
|
|
|
| |
const-correct. No functional changes intended.
llvm-svn: 206491
|
| |
|
|
|
|
| |
template-id after its scope specifier into a single place.
llvm-svn: 206442
|
| |
|
|
|
|
|
| |
we'll already have issued the relevant diagnostic when we saw the declaration
of the primary template.
llvm-svn: 206441
|
| |
|
|
|
|
|
|
| |
subclasses do not call [super init] on their initializers.
Part of rdar://16568441
llvm-svn: 206410
|
| |
|
|
| |
llvm-svn: 206298
|
| |
|
|
| |
llvm-svn: 206275
|
| |
|
|
|
|
|
|
|
|
| |
Parse of nested name spacifier is modified so that it properly recovers
if colon is mistyped as double colon in case statement.
This patch fixes PR15133.
Differential Revision: http://llvm-reviews.chandlerc.com/D2870
llvm-svn: 206135
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds support for the msvc pragmas section, bss_seg, code_seg,
const_seg and data_seg as well as support for __declspec(allocate()).
Additionally it corrects semantics and adds diagnostics for
__attribute__((section())) and the interaction between the attribute
and the msvc pragmas and declspec. In general conflicts should now be
well diganosed within and among these features.
In supporting the pragmas new machinery for uniform lexing for
msvc pragmas was introduced. The new machinery always lexes the
entire pragma and stores it on an annotation token. The parser
is responsible for parsing the pragma when the handling the
annotation token.
There is a known outstanding bug in this implementation in C mode.
Because these attributes and pragmas apply _only_ to definitions, we
process them at the time we detect a definition. Due to tentative
definitions in C, we end up processing the definition late. This means
that in C mode, everything that ends up in a BSS section will end up in
the _last_ BSS section rather than the one that was live at the time of
tentative definition, even if that turns out to be the point of actual
definition. This issue is not known to impact anything as of yet
because we are not aware of a clear use or use case for #pragma bss_seg
but should be fixed at some point.
Differential Revision=http://reviews.llvm.org/D3065#inline-16241
llvm-svn: 205810
|
| |
|
|
| |
llvm-svn: 205715
|
| |
|
|
|
|
|
|
|
|
|
| |
meaningful to odr-use the VarDecl inside a variable template. (Separately, it'd
be nice to track referenced-ness for templates, and warn on unused ones, but
that's really a distinct issue...)
Move a test that generates and tests a warning-suppressing error out to its own
test file, so it doesn't have weird effects on the other tests in the same file.
llvm-svn: 205448
|
| |
|
|
| |
llvm-svn: 205198
|
| |
|
|
|
|
|
| |
A redeclaration may not add dllimport or dllexport attributes. dllexport is
sticky and can be omitted on redeclarations while dllimport cannot.
llvm-svn: 205197
|
| |
|
|
|
|
|
|
|
| |
cannot be a pointer to the private address space (as clarified
in the OpenCL 1.2 specification).
Patch by Fraser Cormack!
llvm-svn: 204941
|