Zhongxing Xu
d09b5205ef
ValueManager::makeNonLoc -> ValueManager::makeIntVal
...
Clean up code with ValueManager.
llvm-svn: 73951
2009-06-23 06:13:19 +00:00
Zhongxing Xu
0442e962d9
If the init list is fewer than the struct fields, bind the rest fields to 0
...
explicitly. Make 0 value with the field type.
llvm-svn: 73949
2009-06-23 05:43:16 +00:00
Zhongxing Xu
b7cf95957d
Instead of setting the default value of the array region, bind the rest of the
...
array elements to 0 explicitly. Create 0 values with the element type.
llvm-svn: 73946
2009-06-23 05:23:38 +00:00
Chris Lattner
c183595534
Fix our check for "random whitespace between a \ and newline" to work
...
with dos style newlines. I have a trivial test for this:
// RUN: clang-cc %s -verify
#define test(x, y) \
x ## y
but I don't know how to get svn to not change newlines and testrunner
doesn't work with dos style newlines either, so "not worth it". :)
rdar://6994000
llvm-svn: 73945
2009-06-23 05:15:06 +00:00
Zhongxing Xu
cbfc7d6c2e
MemRegionManager: Migrate logic for getCodeTextRegion() over to using
...
trait-based MemRegion creation.
llvm-svn: 73941
2009-06-23 03:50:30 +00:00
Zhongxing Xu
1a195b264f
Remove duplicated methods.
...
llvm-svn: 73940
2009-06-23 02:51:21 +00:00
Zhongxing Xu
74fa0bc3de
add a fixme.
...
llvm-svn: 73939
2009-06-23 02:08:56 +00:00
Chris Lattner
4c8da96ea9
fix PR4423.
...
llvm-svn: 73938
2009-06-23 01:38:41 +00:00
Anders Carlsson
5947ddfb55
Check in a new template argument list builder that should work better for variadic templates.
...
llvm-svn: 73937
2009-06-23 01:26:57 +00:00
Chris Lattner
e2170edfbb
switch Warnings.cpp to use the diagnostics machinery to print diagnostics, not *fprintf*!
...
Among other things, this makes the warning about unknown warning options mappable.
For example:
$ clang t.c -Werror -Wfoo
error: unknown warning option '-Wfoo' [-Wunknown-warning-option]
For another thing, they are properly color coded now too :)
llvm-svn: 73936
2009-06-23 01:20:39 +00:00
Ted Kremenek
fb87e30815
MemRegions:
...
- Embed a reference to MemRegionManager objects in MemSpaceRegion objects
- Use this embedded reference for MemRegion objects to access ASTContext objects without external help
- Use this access to ASTContext to simplify 'isBoundable' (no ASTContext& argument required)
llvm-svn: 73935
2009-06-23 00:46:41 +00:00
Chris Lattner
2fe5b26414
__APPLE_CC__ should only be set when building for darwin targets.
...
llvm-svn: 73934
2009-06-23 00:43:21 +00:00
Argyrios Kyrtzidis
dfc5dca1e5
Don't use operator overload '<' for SourceLocation, it has not semantic meaning.
...
llvm-svn: 73932
2009-06-23 00:42:15 +00:00
Argyrios Kyrtzidis
0152c6cbca
In SourceManager::createFileID missed setting ContentCache's FirstFID in another place.
...
llvm-svn: 73931
2009-06-23 00:42:06 +00:00
Argyrios Kyrtzidis
53aeec3b14
Add a comment.
...
llvm-svn: 73930
2009-06-23 00:42:00 +00:00
Ted Kremenek
8bae300ade
MemRegionManager: Migrate logic for getAllocaRegion() over to using trait-based MemRegion creation.
...
llvm-svn: 73927
2009-06-23 00:15:41 +00:00
Ted Kremenek
2266640a7a
MemRegionManager: Migrate getObjCObjectRegion() and getTypedViewRegion() to use
...
the new trait-based construction of MemRegion objects.
llvm-svn: 73926
2009-06-23 00:04:09 +00:00
Fariborz Jahanian
477d242a2e
patch to mark use of implicit copy constructors.
...
llvm-svn: 73922
2009-06-22 23:34:40 +00:00
Ted Kremenek
214cdfea84
Migrate factory methods for FieldRegion and ObjCIVarRegion creation to use the
...
new generalized region-construction code.
llvm-svn: 73921
2009-06-22 23:34:21 +00:00
Douglas Gregor
71a5718f2d
Robustify a bunch of C++-related declaration actions.
...
llvm-svn: 73918
2009-06-22 23:20:33 +00:00
Ted Kremenek
e5e8b0b09b
Refactor some of the logic in MemRegionManager for constructing regions using
...
member template functions and traits. The idea is to allow MemRegionManager to
construct subclasses of MemRegion that aren't declared in MemRegion.h (e.g.,
checker-specific regions).
llvm-svn: 73917
2009-06-22 23:13:13 +00:00
Douglas Gregor
77b50e1126
Implement implicit instantiation of the member functions of a class template
...
specialization. At present, all implicit instantiations occur at the
end of the translation unit.
llvm-svn: 73915
2009-06-22 23:06:13 +00:00
Douglas Gregor
0b6a6242ed
Rework the way we track which declarations are "used" during
...
compilation, and (hopefully) introduce RAII objects for changing the
"potentially evaluated" state at all of the necessary places within
Sema and Parser. Other changes:
- Set the unevaluated/potentially-evaluated context appropriately
during template instantiation.
- We now recognize three different states while parsing or
instantiating expressions: unevaluated, potentially evaluated, and
potentially potentially evaluated (for C++'s typeid).
- When we're in a potentially potentially-evaluated context, queue
up MarkDeclarationReferenced calls in a stack. For C++ typeid
expressions that are potentially evaluated, we will play back
these MarkDeclarationReferenced calls when we exit the
corresponding potentially potentially-evaluated context.
- Non-type template arguments are now parsed as constant
expressions, so they are not potentially-evaluated.
llvm-svn: 73899
2009-06-22 20:57:11 +00:00
Fariborz Jahanian
18eb69af79
Changes made per Doug's comments.
...
llvm-svn: 73897
2009-06-22 20:37:23 +00:00
Fariborz Jahanian
3a36343b88
Remove ImplicitMustBeDefined, use universal 'Used' flag
...
instead. Do the implicit default ctor checking in MarkDeclarationReferenced.
llvm-svn: 73888
2009-06-22 17:30:33 +00:00
Argyrios Kyrtzidis
49abd4d95b
Addressing Doug's suggestions:
...
-Added comment for FunctionDecl::EndRangeLoc
-Removed a redundant check from FunctionDecl::setBody
llvm-svn: 73886
2009-06-22 17:13:31 +00:00
Zhongxing Xu
8077d7eb15
Allow CodeTextRegion to be cast to 'void *'.
...
llvm-svn: 73880
2009-06-22 08:36:10 +00:00
Fariborz Jahanian
99b57fb987
Renamed Protocol as TheProtocol so people can use clang header for
...
building obj-c++ clients. "Protocol" is a class name in Cocoa.h
llvm-svn: 73854
2009-06-21 18:26:03 +00:00
Zhongxing Xu
540c009fbe
Return UnknownVal for pointer arithmetic on struct fields.
...
llvm-svn: 73851
2009-06-21 13:24:24 +00:00
Fariborz Jahanian
1c9d5d956c
Made improvements in c++'s object model patch on Doug's review.
...
llvm-svn: 73833
2009-06-20 20:23:38 +00:00
Argyrios Kyrtzidis
69c2e0635a
Slight modification to column checking inside SourceManager::getLocation().
...
llvm-svn: 73826
2009-06-20 08:40:15 +00:00
Argyrios Kyrtzidis
3a08ec1662
Add the license part to the new source files.
...
llvm-svn: 73825
2009-06-20 08:27:14 +00:00
Argyrios Kyrtzidis
88f663c04d
Introduce SourceManager::getLocation() to get a source location out of a "file:line:column" triplet.
...
llvm-svn: 73823
2009-06-20 08:09:57 +00:00
Argyrios Kyrtzidis
1ead0b42db
Serialize FunctionDecl's EndRangeLoc out to the PCH file.
...
llvm-svn: 73822
2009-06-20 08:09:34 +00:00
Argyrios Kyrtzidis
a3aeb5a8f1
Introduce Decl::getSourceRange() which, like Stmt::getSourceRange(), represents the range that the declaration covers.
...
Add initial support for NamespaceDecl, VarDecl, and FunctionDecl:
-NamespaceDecl range is from name to '}'
-VarDecl is from name to possible init expression
-FunctionDecl is from name to last parameter name or to end of its function body.
llvm-svn: 73821
2009-06-20 08:09:14 +00:00
Argyrios Kyrtzidis
ce3797527e
Introduce the ASTUnit class.
...
ASTUnit is a helper class to allow easy loading of an ASTContext from a PCH file. No users for now.
llvm-svn: 73819
2009-06-20 08:08:23 +00:00
Douglas Gregor
fec52635f0
Parsing and AST support for using declarations, from John Thompson!
...
llvm-svn: 73812
2009-06-20 00:51:54 +00:00
Fariborz Jahanian
e8918d52d1
Added writing and reading of the ConstQualAdded flag of
...
BlockDeclRefExpr to PCH.
llvm-svn: 73800
2009-06-20 00:02:26 +00:00
Douglas Gregor
c9c02ed8f4
Keep track of when declarations are "used" according to C and
...
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.
This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.
llvm-svn: 73797
2009-06-19 23:52:42 +00:00
Fariborz Jahanian
3fd7310d70
Use QualType to represent block's implicit return type as
...
to not lose its 'const/volatile' qualifier.
llvm-svn: 73795
2009-06-19 23:37:08 +00:00
Fariborz Jahanian
423a81f259
Patch for implementation of C++'s object model. This is
...
work in progress.
llvm-svn: 73782
2009-06-19 19:55:27 +00:00
Ted Kremenek
c55f0cdaa0
Remove more GetSVal/GetLValue methods in GRExprEngine/GRState, instead
...
preferring to use their replacements in GRState. This further unifies the code
paths for such logic and leads to some code reduction.
llvm-svn: 73771
2009-06-19 17:10:32 +00:00
Argyrios Kyrtzidis
e55f6ff3de
Fix bug in the new PCHReader constructor. PP and Context should be initialized to 0.
...
llvm-svn: 73762
2009-06-19 07:55:35 +00:00
Zhongxing Xu
54fb536b5c
A further step of r73690: associate the cast-to type with the created symbol,
...
because the type of the symbol is used to create the default range. We need the
sign to be consistent.
llvm-svn: 73756
2009-06-19 06:00:32 +00:00
Zhongxing Xu
cc45762253
If the SymbolicRegion was cast to another type, use that type to create the
...
ElementRegion.
llvm-svn: 73754
2009-06-19 04:51:14 +00:00
Argyrios Kyrtzidis
366985d5eb
Make changes to PCHReader to allow reading a PCH file without having a pre-initialized Preprocessor.
...
-Introduce 'PCHReaderListener' which is an abstract interface for getting various information from the PCHReader.
-If PCHReader is constructed without a Preprocessor, it can still load the file and invoke the callbacks of PCHReaderListener.
-If PCHReader is constructed with an initialized Preprocessor, PCHValidator is used as a PCHReaderListener to validate the contents of the PCH file against the given Preprocessor.
llvm-svn: 73741
2009-06-19 00:03:23 +00:00
Ted Kremenek
095f1a9848
Move clients over from using GRStateManager::BindXXX and friends to
...
GRState->bindXXX and friends (and constify some arguments along the way).
llvm-svn: 73740
2009-06-18 23:58:37 +00:00
Ted Kremenek
4c6a367182
Remove GRStateManager& field from SimpleConstraintManager.
...
llvm-svn: 73735
2009-06-18 23:20:05 +00:00
Ted Kremenek
f9906843b7
libAnalysis:
...
- Remove the 'isFeasible' flag from all uses of 'Assume'.
- Remove the 'Assume' methods from GRStateManager. Now the only way to
create a new GRState with an assumption is to use the new 'assume' methods
in GRState.
llvm-svn: 73731
2009-06-18 22:57:13 +00:00
Douglas Gregor
1e09bf83c0
Some cleanups suggested by Chris
...
llvm-svn: 73713
2009-06-18 18:45:36 +00:00
Douglas Gregor
78bd61f661
Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.
...
llvm-svn: 73702
2009-06-18 16:11:24 +00:00
Douglas Gregor
e1d15c80a3
Add some missing CMake dependencies
...
llvm-svn: 73700
2009-06-18 15:05:47 +00:00
Zhongxing Xu
cea6578078
When casting region, if we do not create an element region, record the cast-to
...
type.
When retrieving the region value, if we are going to create a symbol value, use
the cast-to type if possible.
llvm-svn: 73690
2009-06-18 06:29:10 +00:00
Chris Lattner
e7e659431c
Fix a crash that can occur when a #pragma handler eats to the end of the
...
line, and when the pragma is at the end of a file. In this case, the last
token consumed could pop the lexer, invalidating CurPPLexer. Thanks to
Peter Thoman for pointing it out.
llvm-svn: 73689
2009-06-18 05:55:53 +00:00
Ted Kremenek
6a667ab710
Remove GRStateRef.
...
llvm-svn: 73670
2009-06-18 01:33:24 +00:00
Ted Kremenek
d93c6e3fd6
Remove more dependencies on GRStateRef. As a consequence, we can now
...
pretty-print a GRState object anywhere it is referenced (instead of
needing a GRStateRef of a GRStateManager handy).
llvm-svn: 73669
2009-06-18 01:23:53 +00:00
Ted Kremenek
89a303caac
Remove another dependency on GRStateRef.
...
llvm-svn: 73667
2009-06-18 00:49:02 +00:00
Douglas Gregor
f187420feb
Diagnose class members that shadow a template parameter. Fixes
...
<rdar://problem/6952203>.
To do this, we actually remove a not-quite-correct optimization in the
C++ name lookup routines. We'll revisit this optimization for the
general case once more C++ is working.
llvm-svn: 73659
2009-06-17 23:37:01 +00:00
Argyrios Kyrtzidis
9941a4d314
Fix some erroneous comments due to trigger-happy copy&paste.
...
No functionality change.
llvm-svn: 73657
2009-06-17 23:19:02 +00:00
Argyrios Kyrtzidis
7bcce49e04
Factor out some common code into Sema::EnterDeclaratorContext/ExitDeclaratorContext.
...
llvm-svn: 73655
2009-06-17 23:15:40 +00:00
Argyrios Kyrtzidis
3df1978270
Implement correct name lookup inside an initializer of a C++ class static data member.
...
Fixes "test/CXX/basic/basic.lookup/basic.lookup.unqual/p13.cpp" test case.
llvm-svn: 73652
2009-06-17 22:50:06 +00:00
Argyrios Kyrtzidis
c4b766bc65
Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.
...
llvm-svn: 73651
2009-06-17 22:49:50 +00:00
Fariborz Jahanian
b1743254e7
Removed deadcode related to addition of constructor
...
decls to a class.
llvm-svn: 73650
2009-06-17 22:44:31 +00:00
Steve Naroff
fb4330f255
First step toward fixing <rdar://problem/6613046> refactor clang objc type representation.
...
Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType).
This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types).
No functionality change.
llvm-svn: 73649
2009-06-17 22:40:22 +00:00
Ted Kremenek
b35e2caab5
Remove more uses of GRStateRef.
...
llvm-svn: 73648
2009-06-17 22:28:13 +00:00
Ted Kremenek
609df30929
Start moving in the direction of removing GRStateRef. Now each
...
GRState object has a direct reference to its GRStateManager, making
the functionality of GRStateRef redunandant. This will lead to some
nice API cleanup and code shrinking across libAnalysis.
llvm-svn: 73644
2009-06-17 22:02:04 +00:00
Douglas Gregor
758a869b14
Support dependent extended vector types and template instantiation
...
thereof. Patch by Anders Johnsen!
llvm-svn: 73641
2009-06-17 21:51:59 +00:00
Douglas Gregor
791505b5ea
Search path for 64-bit Ubuntu Linux, from Anders Johnsen
...
llvm-svn: 73637
2009-06-17 21:18:36 +00:00
Douglas Gregor
6b6bba4a20
Diagnose the use of attributes on namespace aliases, from Anis Ahmad
...
llvm-svn: 73626
2009-06-17 19:49:00 +00:00
Chris Lattner
94dfae248b
Update clang for the add ->add/fadd split. Likewise for sub and mul.
...
llvm-svn: 73604
2009-06-17 06:36:24 +00:00
Daniel Dunbar
10978e414c
Stub out printing of the thread model with -v.
...
- Turns out libstdcxx greps for this in configure.
llvm-svn: 73582
2009-06-16 23:32:58 +00:00
Daniel Dunbar
1b3ec3a000
Fake support for -print-multi-*
...
- I think we will eventually need to support this for realz, and some build
processes seem to depend on these options.
llvm-svn: 73581
2009-06-16 23:25:22 +00:00
Anders Carlsson
655908aaf7
Since integral template arguments can't have dependent types we don't need an extra pass to set the right APSInt bit width/signedness.
...
llvm-svn: 73580
2009-06-16 23:08:29 +00:00
Anders Carlsson
3a106e0b1c
Make DeduceNonTypeTemplateArgument take an APSInt instead of an APInt.
...
llvm-svn: 73574
2009-06-16 22:44:31 +00:00
Ted Kremenek
4533a55696
RegionStoreManager:
...
- Add "sections" to RegionStoreManager.cpp to delineate functionality.
- Add new function "CreateFieldsOnlyRegionStoreManager" that uses the new
RegionStoreFeatures class to use a reduced set of features from
RegionStoreManager (in this case, only field-sensitivity). This isn't
completely hooked up yet.
llvm-svn: 73572
2009-06-16 22:36:44 +00:00
Daniel Dunbar
2d5f363d6d
Fix typo in prev commit.
...
llvm-svn: 73556
2009-06-16 21:46:01 +00:00
Daniel Dunbar
79c459932b
Darwin/Driver: Also look at -arch command line options when finding the default
...
tool chain.
llvm-svn: 73555
2009-06-16 21:39:33 +00:00
Douglas Gregor
274a6b4f2d
Update Clang to include the InitializeAllTargets and
...
InitializeAllAsmPrinters LLVM headers. Also includes some minor fixes
for the CMake-based build with Xcode.
llvm-svn: 73544
2009-06-16 20:13:51 +00:00
Devang Patel
9fc4341eec
It is possible that main input file does not have any symbol with debug info. To handle this edge case, always create main compile unit first.
...
This fixes PR 4228.
llvm-svn: 73520
2009-06-16 18:02:02 +00:00
Chris Lattner
651a221cc2
follow-on to my patch: some targets (like sparc) do not
...
have target-specific builtins, and do not set the count.
Just default to 0 for these targets.
llvm-svn: 73510
2009-06-16 17:27:50 +00:00
Fariborz Jahanian
0571d9bbba
Implements -Wundeclared-selector for ObjC.
...
llvm-svn: 73495
2009-06-16 16:25:00 +00:00
Chris Lattner
4ef49c1d6e
my refactoring of builtins changed target-specific builtins to only be
...
registered when PCH wasn't being used. We should always install (in BuiltinInfo)
information about target-specific builtins, but we shouldn't register any builtin
identifier infos. This fixes the build of apps that use PCH and target specific
builtins together.
llvm-svn: 73492
2009-06-16 16:18:48 +00:00
Zhongxing Xu
838a0db0ba
Use canonical type for building ElementRegion. Otherwise ElementRegions cannot
...
be unique.
llvm-svn: 73482
2009-06-16 09:55:50 +00:00
Zhongxing Xu
e531f048f8
Do not invalidate unboundable regions in GRSimpleVals::EvalCall().
...
llvm-svn: 73474
2009-06-16 06:18:21 +00:00
Anders Carlsson
a42ab8f3d5
Handle temporaries in default arguments.
...
llvm-svn: 73462
2009-06-16 03:37:31 +00:00
Anders Carlsson
90036dc96a
Keep track of whether a type parameter type is a parameter pack.
...
llvm-svn: 73452
2009-06-16 00:30:48 +00:00
Steve Naroff
853308d89d
Add a comment to Sema::ActOnTranslationUnitScope().
...
llvm-svn: 73450
2009-06-16 00:20:10 +00:00
Ted Kremenek
96aa146d90
Fix: <rdar://problem/6945561> -[CIContext createCGLayerWithSize:info:] misinterpreted by clang scan-build
...
llvm-svn: 73415
2009-06-15 20:58:58 +00:00
Ted Kremenek
3092e9c5c2
Fix: <rdar://problem/6961230> add knowledge of IOKit functions to retain/release checker
...
llvm-svn: 73411
2009-06-15 20:36:07 +00:00
Eli Friedman
dd2ab963de
PR4395: Don't detect token concatenation in C mode for
...
C++-specific tokens.
llvm-svn: 73408
2009-06-15 19:48:50 +00:00
Douglas Gregor
f39bf33dc0
More XML output support, from Olaf Krzikalla!
...
llvm-svn: 73402
2009-06-15 19:02:54 +00:00
Anders Carlsson
475501b01c
More parameter pack work.
...
llvm-svn: 73395
2009-06-15 17:56:45 +00:00
Anders Carlsson
bc34391f04
Add a new 'Pack' argument kind to TemplateArgument. This is not yet used.
...
llvm-svn: 73391
2009-06-15 17:04:53 +00:00
Douglas Gregor
15e08d8567
Base SFINAE error suppression counting on the class of an error, not
...
its (possibly-remapped) diagnostics. Thanks, Chris!
llvm-svn: 73390
2009-06-15 16:52:15 +00:00
Eli Friedman
b188455eb2
PR4388: get rid of an extra # line directive; in addition to being
...
unnecessary, this was causing issues for assembler-with-cpp mode, which
doesn't process the directive.
llvm-svn: 73382
2009-06-15 09:57:52 +00:00
Chris Lattner
6ed7d5964e
Minor tweak to -fdiagnostics-print-source-range-info to make it print
...
ranges more similar to the console output. Consider:
#define FOO(X, Y) X/ Y
void foo(int *P, int *Q) {
FOO(P, Q);
}
Before we emitted:
t.c:4:3:{4:3-4:6}{4:3-4:6}: error: invalid operands to binary expression ('int *' and 'int *')
FOO(P, Q);
^~~~~~~~~
...
Note that while we underline the macro args that the range info just includes FOO
without its macros. This change teaches the printed ranges to include macro args
also so that we get:
t.c:4:3:{4:3-4:12}{4:3-4:12}: error: invalid operands to binary expression ('int *' and 'int *')
FOO(P, Q);
^~~~~~~~~
...
This fixes rdar://6939599
llvm-svn: 73378
2009-06-15 05:18:27 +00:00
Chris Lattner
d9efb6ee52
Fix #pragma GCC system_header by making it insert a virtual linemarker into
...
the file at the point of the pragma. This allows clang to know that all
sourcelocations after the pragma are in a system header.
llvm-svn: 73376
2009-06-15 05:02:34 +00:00
Chris Lattner
d20dc87009
If PCH refers to a file that doesn't exist anymore, emit a nice error
...
like:
fatal error: could not find file '1.h' referenced by PCH file
instead of aborting with an assertion failure, PR4219
llvm-svn: 73371
2009-06-15 04:35:16 +00:00
Chris Lattner
6b8f78eb03
use the new Path::isAbsolute function, fixing a fixme. Patch by Gregory Curfman!
...
llvm-svn: 73370
2009-06-15 04:25:18 +00:00
Chris Lattner
a5e67757dc
no really, add the lines :)
...
llvm-svn: 73367
2009-06-15 04:08:28 +00:00
Chris Lattner
f2d49da9a8
Fix PR2741 by making our newline tracking be aware of newlines that
...
can occur in the middle of comment tokens.
llvm-svn: 73365
2009-06-15 01:25:23 +00:00
Chris Lattner
c7d2bfacef
"GCC emits an __objc_class_name_{classname} symbol for every class, and a corresponding reference to this symbol for every compilation unit that references the class. This causes linker errors when you try linking a program which references some classes but doesn't define them. The attached patch implements this support in clang, so you can compile a class with clang, reference it in a file compiled with GCC, and have it all work correctly."
...
Patch by David Chisnall!
llvm-svn: 73364
2009-06-15 01:09:11 +00:00
Eli Friedman
1cf2536d6c
PR4391: Tweak -ast-print output to generate valid output for edge cases
...
like "int x = + +3;".
llvm-svn: 73356
2009-06-14 22:39:26 +00:00
Eli Friedman
6282b3cff8
PR4390: Make sure to handle anonymous unions correctly while building
...
static intializers for structs.
llvm-svn: 73349
2009-06-14 21:41:37 +00:00
Douglas Gregor
e141633f55
Introduce a SFINAE "trap" that keeps track of the number of errors
...
that were suppressed due to SFINAE. By checking whether any errors
occur at the end of template argument deduction, we avoid the
possibility of suppressing an error (due to SFINAE) and then
recovering so well that template argument deduction never detects that
there was a problem. Thanks to Eli for the push in this direction.
llvm-svn: 73336
2009-06-14 08:02:22 +00:00
Douglas Gregor
33834516f3
Update LLVM.
...
Implement support for C++ Substitution Failure Is Not An Error
(SFINAE), which says that errors that occur during template argument
deduction do *not* produce diagnostics and do not necessarily make a
program ill-formed. Instead, template argument deduction silently
fails. This is currently implemented for template argument deduction
during matching of class template partial specializations, although
the mechanism will also apply to template argument deduction for
function templates. The scheme is simple:
- If we are in a template argument deduction context, any diagnostic
that is considered a SFINAE error (or warning) will be
suppressed. The error will be propagated up the call stack via the
normal means.
- By default, all warnings and errors are SFINAE errors. Add the
NoSFINAE class to a diagnostic in the .td file to make it a hard
error (e.g., for access-control violations).
Note that, to make this fully work, every place in Sema that emits an
error *and then immediately recovers* will need to check
Sema::isSFINAEContext() to determine whether it must immediately
return an error rather than recovering.
llvm-svn: 73332
2009-06-14 07:33:30 +00:00
Eli Friedman
334046a134
PR4351: Add constant evaluation for constructs like "foo == NULL", where
...
foo has a constant address.
llvm-svn: 73321
2009-06-14 02:17:33 +00:00
Chris Lattner
15ba94987a
Sink the BuiltinInfo object from ASTContext into the
...
preprocessor and initialize it early in clang-cc. This
ensures that __has_builtin works in all modes, not just
when ASTContext is around.
llvm-svn: 73319
2009-06-14 01:54:56 +00:00
Chris Lattner
5abdec7978
move the various builtins stuff from libast to libbasic. This
...
fixes a layering violation in lib/Basic/Targets.cpp.
llvm-svn: 73318
2009-06-14 01:05:48 +00:00
Chris Lattner
3d4ead17c7
prune #includes, Builtins.h/cpp no longer depends on libast.
...
llvm-svn: 73317
2009-06-14 00:52:07 +00:00
Chris Lattner
ecd79c6353
move GetBuiltinType from Builtin::Context to ASTContext.
...
llvm-svn: 73316
2009-06-14 00:45:47 +00:00
Chris Lattner
8e3eed0890
change ParseStatementOrDeclaration to emit the 'missing ;' with
...
ExpectAndConsume instead of custom diag logic. This gets us an
insertion hint and positions the ; at the end of the line
instead of on the next token. Before:
t.c:5:1: error: expected ';' after return statement
}
^
after:
t.c:4:11: error: expected ';' after return statement
return 4
^
;
llvm-svn: 73315
2009-06-14 00:23:56 +00:00
Chris Lattner
34a9566c8c
improve localizability by not passing english phrases into
...
diagnostics in some cases.
llvm-svn: 73314
2009-06-14 00:07:48 +00:00
Chris Lattner
d50fea52af
Simplify mangleFunctionDecl by unnesting a crazy condition. This fixes
...
the check for extern "c" system headers, which should prevent functiondecls
from being mangled.
llvm-svn: 73311
2009-06-13 23:34:16 +00:00
Eli Friedman
3192cc8526
Fix the calling convention for structs/unions containing SSE vectors on
...
x86-32. This is slightly messy, but I think it's consistent with gcc.
llvm-svn: 73306
2009-06-13 21:37:10 +00:00
Anders Carlsson
40c1d49615
Have CheckClassTemplatePartialSpecializationArgs take a TemplateArgumentListBuilder. No functionality change.
...
llvm-svn: 73297
2009-06-13 18:20:51 +00:00
Eli Friedman
9782caa369
Allow initializing a vector with a vector in addition to allowing a list
...
of the elements. Issue reported on cfe-dev by Mattias Holm.
llvm-svn: 73292
2009-06-13 10:38:46 +00:00
Chris Lattner
b6f77af532
implement and document a new __has_feature and __has_builtin magic
...
builtin preprocessor macro. This appears to work with two caveats:
1) builtins are registered in -E mode, and 2) target-specific builtins
are unconditionally registered even if they aren't supported by the
target (e.g. SSE4 builtin when only SSE1 is enabled).
llvm-svn: 73289
2009-06-13 07:13:28 +00:00
Eli Friedman
9a0e23c495
Fix for PR4382: allow instantiating dependent nested name specifiers.
...
I'm not completely sure this is the right way to fix this issue, but it seems
reasonable, and it's consistent with the non-template code for this
construct.
llvm-svn: 73285
2009-06-13 04:51:30 +00:00
Anders Carlsson
20ee0ed4ea
If a CXXRecordDecl is a class template, the 'this' type should be the injected class name type. Fixes pr4383.
...
llvm-svn: 73284
2009-06-13 02:59:33 +00:00
Anders Carlsson
15201f19ba
More work on type parameter packs.
...
llvm-svn: 73281
2009-06-13 02:08:00 +00:00
Zhongxing Xu
70b27e6f8b
Stop tracking non-compound value for struct. It may be caused by imprecise cast
...
logic.
llvm-svn: 73279
2009-06-13 01:31:11 +00:00
Douglas Gregor
4f024b2046
Remove a bunch of unnecessary template argument deduction code that was
...
obviously written by someone who didn't read C++ [temp.class.spec].
llvm-svn: 73276
2009-06-13 00:59:32 +00:00
Anders Carlsson
c8cbb2d08c
Move template type argument checking out into a separate function. No functionality change.
...
llvm-svn: 73275
2009-06-13 00:33:33 +00:00
Douglas Gregor
91772d1d76
When some template parameters of a class template partial
...
specialization cannot be deduced, produce a warning noting that the
affected class template partial specialization will never be used.
llvm-svn: 73274
2009-06-13 00:26:55 +00:00
Chris Lattner
4ca97c3b9e
Fix PR4372, another case where non-prototyped functions can prevent
...
always_inline from working.
llvm-svn: 73273
2009-06-13 00:26:38 +00:00
Anders Carlsson
aa73b9135a
Improvements to TemplateArgumentListBuilder to make it work better with parameter packs.
...
llvm-svn: 73272
2009-06-13 00:08:58 +00:00
Anders Carlsson
327865db53
A parameter pack must always come last in a class template.
...
llvm-svn: 73269
2009-06-12 23:20:15 +00:00
Anders Carlsson
508caaec3b
No need to mark the parameter as invalid, just ignore the default argument.
...
llvm-svn: 73268
2009-06-12 23:13:22 +00:00
Anders Carlsson
f986ba7528
Address more comments from Doug.
...
llvm-svn: 73267
2009-06-12 23:09:56 +00:00
Chris Lattner
815b70efcd
add the location of the ')' in a do/while statement to DoStmt.
...
This fixes a source range problem reported by Olaf Krzikalla.
llvm-svn: 73266
2009-06-12 23:04:47 +00:00
Anders Carlsson
15f1dd1c88
Address comments from Doug - Add a Sema::SemaRef.BuildBlockPointerType and use it.
...
llvm-svn: 73264
2009-06-12 22:56:54 +00:00
Douglas Gregor
170bc42547
It looks like we've finished off matching of class template partial specializations; add comments and update the C++ status page
...
llvm-svn: 73263
2009-06-12 22:31:52 +00:00
Anders Carlsson
d382435014
Parameter packs can't have default arguments.
...
llvm-svn: 73262
2009-06-12 22:30:13 +00:00
Anders Carlsson
fb1d776ff0
Keep track of whether a type parameter is actually a type parameter pack.
...
llvm-svn: 73261
2009-06-12 22:23:22 +00:00
Douglas Gregor
30b0197169
Finish implementing checking of class template partial specializations
...
llvm-svn: 73260
2009-06-12 22:21:45 +00:00
Douglas Gregor
09a3023e65
Diagnose C++ [temp.class.spec]p9b3, where a class template partial
...
specialization's arguments are identical to the implicit template
arguments of the primary template. Typically, this is meant to be a
declaration/definition of the primary template, so we give that
advice.
llvm-svn: 73259
2009-06-12 22:08:06 +00:00
Douglas Gregor
8cfd2ba76d
Diagnose the incorrect use of non-type template arguments for class
...
template partial specializations.
llvm-svn: 73254
2009-06-12 21:21:02 +00:00
Anders Carlsson
01e9e93485
Parse support for C++0x type parameter packs.
...
llvm-svn: 73247
2009-06-12 19:58:00 +00:00
Douglas Gregor
d52220513f
Verify that the template parameters of a class template partial
...
specialization do not have default arguments
(C++ [temp.class.spec]p10).
llvm-svn: 73245
2009-06-12 19:43:02 +00:00
Anders Carlsson
b0e8e228ff
Fix PR4365.
...
llvm-svn: 73240
2009-06-12 18:53:02 +00:00
Douglas Gregor
181aa4a250
Improve template argument deduction to keep track of why template
...
argument deduction failed. For example, given
template<typename T> struct is_same<T, T> { ... };
template argument deduction will fail for is_same<int, float>, and now
reports enough information
Right now, we don't do anything with this extra information, but it
can be used for informative diagnostics that say, e.g., "template
argument deduction failed because T was deduced to 'int' in one
context and 'float' in another".
llvm-svn: 73237
2009-06-12 18:26:56 +00:00
Anders Carlsson
84613c4eba
It's an error to use a function declared in a class definition as a default argument before the function has been declared.
...
llvm-svn: 73234
2009-06-12 16:51:40 +00:00
Anders Carlsson
a767eeed19
Deducation and instantiation of block types.
...
llvm-svn: 73232
2009-06-12 16:23:10 +00:00
Zhongxing Xu
2693c504c2
use getAsPointerType() method.
...
llvm-svn: 73218
2009-06-12 03:59:12 +00:00
Anders Carlsson
8783543a6f
Don't assert when generating code with static_asserts.
...
llvm-svn: 73208
2009-06-11 21:22:55 +00:00
Eli Friedman
7433a248e3
PR4371: Reduce the inlining threshold outside of -O3. This makes
...
the clang inlining threshold consistent with the threshold for llvm-gcc.
llvm-svn: 73204
2009-06-11 20:33:41 +00:00
Eli Friedman
9d79bdaaad
Following gcc, hide the hack to include the SSE2 intrinsics from
...
xmmintrin.h in an ifdef.
llvm-svn: 73200
2009-06-11 18:50:02 +00:00
Ted Kremenek
ea675cf6a3
Add summary lookup for IOServiceGetMatchingService.
...
Convert tabs to spaces.
llvm-svn: 73198
2009-06-11 18:17:24 +00:00
Ted Kremenek
a74ead4103
Refactor some function name -> summary lookup using a switch statement.
...
llvm-svn: 73197
2009-06-11 18:10:48 +00:00
Douglas Gregor
74eba0b679
Once we have deduced the template arguments of a class template
...
partial specialization, substitute those template arguments back into
the template arguments of the class template partial specialization to
see if the results still match the original template arguments.
This code is more general than it needs to be, since we don't yet
diagnose C++ [temp.class.spec]p9. However, it's likely to be needed
for function templates.
llvm-svn: 73196
2009-06-11 18:10:32 +00:00
Anders Carlsson
40ed344c92
Add a null check that fixes the crash in PR4362, and make sure to instantiate non-type template arguments.
...
llvm-svn: 73193
2009-06-11 16:06:49 +00:00
Zhongxing Xu
519a47d4bd
Bind the mistakenly generated nonloc::SymbolVal to struct correctly. See the
...
comments for added test case for details.
llvm-svn: 73189
2009-06-11 09:11:27 +00:00
Zhongxing Xu
d85a991253
Use more robust getAsRecordType() method.
...
llvm-svn: 73186
2009-06-11 07:27:30 +00:00
Eli Friedman
dd49ee3fb4
Make sure to calculate value-dependence correctly when deal with ICEs.
...
(Actually, this isn't precisely correct, but it doesn't make
sense to query whether an expression that isn't an ICE is
value-dependent anyway.)
llvm-svn: 73179
2009-06-11 01:11:20 +00:00
Eli Friedman
6d692cc2e8
PR4364: fix parsing 'typename' in an expression.
...
llvm-svn: 73177
2009-06-11 00:33:41 +00:00
Douglas Gregor
c43620dedf
Separate TemplateArgument instantiation logic into its own function. No functionality change.
...
llvm-svn: 73176
2009-06-11 00:06:24 +00:00
Douglas Gregor
637d9984f0
Template argument deduction for member pointers.
...
Also, introduced some of the framework for performing instantiation as
part of template argument deduction.
llvm-svn: 73175
2009-06-10 23:47:09 +00:00
Daniel Dunbar
76d864c7e7
Support complex properties, ivars and message expressions.
...
llvm-svn: 73158
2009-06-10 04:38:50 +00:00
Eli Friedman
f479984762
PR4350: Make sure we don't create invalid printf attributes. This isn't
...
visible anywhere normally because the printf format checks for
this case, and we don't print out attribute values anywhere. Original
patch by Roberto Bagnara.
llvm-svn: 73157
2009-06-10 04:01:38 +00:00
Eli Friedman
28a00aa646
PR4353: Add support for \E as a character escape.
...
llvm-svn: 73153
2009-06-10 01:32:39 +00:00
Douglas Gregor
0bdc1f5eef
Handle member pointer types with dependent class types (e.g., int
...
T::*) and implement template instantiation for member pointer types.
llvm-svn: 73151
2009-06-09 22:17:39 +00:00
Douglas Gregor
4fbe3e3014
Implement template argument deduction for class template
...
specialization types. As the example shows, we can now compute the
length of a type-list using a template metaprogram and class template
partial specialization.
llvm-svn: 73136
2009-06-09 16:35:58 +00:00
Eli Friedman
53339e0fdb
Add more parser support for Microsoft extensions.
...
llvm-svn: 73101
2009-06-08 23:27:34 +00:00
Daniel Dunbar
eed62b7c4b
Add stack alignment to x86_64 target data.
...
- <rdar://problem/6948443> WARNING: Linking two modules of different data
layouts!
llvm-svn: 73093
2009-06-08 22:39:13 +00:00
Daniel Dunbar
367dbb9760
Forward -C and -CC to clang.
...
- <rdar://problem/6945384> Driver should pass down -C and -CC
llvm-svn: 73087
2009-06-08 21:48:20 +00:00
Eli Friedman
ebb9e4dc4d
Minor tweaks to the Windows target.
...
llvm-svn: 73083
2009-06-08 21:16:17 +00:00
Daniel Dunbar
db09702e2a
PR4016: Forward -fno-show-source-location to clang.
...
llvm-svn: 73082
2009-06-08 21:13:54 +00:00
Eli Friedman
cf432d3c7b
PR4346: add "R" asm register constraint.
...
llvm-svn: 73081
2009-06-08 20:45:44 +00:00
Anders Carlsson
096e6eeb68
Address comments from Doug.
...
llvm-svn: 73077
2009-06-08 19:22:23 +00:00
Douglas Gregor
f661016b03
Document the template argument deduction patterns that Anders' patch supports
...
llvm-svn: 73071
2009-06-08 15:59:14 +00:00
Anders Carlsson
2128ec7cdd
Template argument deduction for function types.
...
llvm-svn: 73070
2009-06-08 15:19:08 +00:00
Eli Friedman
06de2b5525
Add real parsing for __declspec. It doesn't make much of a difference
...
at the moment because we ignore the result.
llvm-svn: 73056
2009-06-08 07:21:15 +00:00
Eli Friedman
aa27a87ab3
Misc minor fixes for clang for the Windows target.
...
llvm-svn: 73050
2009-06-08 06:11:14 +00:00
Eli Friedman
a6638ca3a3
Delete method which is now trivial.
...
llvm-svn: 73043
2009-06-08 05:08:54 +00:00
Eli Friedman
9e81b02ec5
Don't allow defining a block with a non-prototype type. Remove a
...
hack which introduces some strange inconsistencies in compatibility
for block pointers.
Note that unlike an earlier revision proposed on cfe-commits, this patch
still allows declaring block pointers without a prototype.
llvm-svn: 73041
2009-06-08 04:24:21 +00:00
Anders Carlsson
0880e9f58d
Instantiation support for more Obj-C expressions, string literals, @selector and @protocol expressions.
...
llvm-svn: 73036
2009-06-07 19:51:47 +00:00
Anders Carlsson
315d2294f8
Template instantiation support for Obj-C @encode expressions.
...
llvm-svn: 73034
2009-06-07 18:45:35 +00:00
Zhongxing Xu
aaa86d07a0
Remove dead code: 'NewEntry' is not used.
...
llvm-svn: 73027
2009-06-07 11:18:14 +00:00
Eli Friedman
e9ff191459
Remove a few more vector builtins.
...
llvm-svn: 73022
2009-06-07 09:32:56 +00:00
Daniel Dunbar
fcec758f4e
xmmintrin needs to include emmintrin, Darwin system headers seem to depend on it
...
defining m128[id], at least.
llvm-svn: 73021
2009-06-07 08:33:23 +00:00
Eli Friedman
5a996fc0fc
Now that LLVM CodeGen can handle the generic variations a bit better,
...
get rid of a few more clang vector builtins.
llvm-svn: 73015
2009-06-07 07:12:56 +00:00
Douglas Gregor
e183993ffa
CMake: Install Clang's headers into the right place in the build tree, for regression testing
...
llvm-svn: 73014
2009-06-07 07:09:23 +00:00
Eli Friedman
07bbeca406
PR4339: make sure to properly extend/trunc the index of a vector element
...
insert/extract; the relevant instructions are defined to take only an
i32.
llvm-svn: 73005
2009-06-06 19:09:26 +00:00
Fariborz Jahanian
28c5a8ba4a
Adds synthesize ivars to DeclContext.
...
llvm-svn: 73000
2009-06-06 16:36:41 +00:00
Anton Korobeynikov
18adbf5f07
Add new ABIArgInfo kind: Extend. This allows target to implement its own argument
...
zero/sign extension logic (consider, e.g. target has only 64 bit registers and thus
i32's should be extended as well).
llvm-svn: 72998
2009-06-06 09:36:29 +00:00
Eli Friedman
6813eb125f
Get rid of a bunch of dead builtins.
...
llvm-svn: 72996
2009-06-06 08:31:46 +00:00
Eli Friedman
4d8d7d3263
Replace more calls to builtins with generic code.
...
llvm-svn: 72995
2009-06-06 08:08:06 +00:00
Eli Friedman
f5f303f92f
Fix obvious typo.
...
llvm-svn: 72994
2009-06-06 07:42:17 +00:00
Anders Carlsson
8544647e9c
Make ParmVarDecl::getDefaultArg() more robust, it now asserts that the argument is not unparsed. Add a new hasDefaultArg() and use it in places where getDefaultArg() was called when the argument was unparsed.
...
llvm-svn: 72984
2009-06-06 04:14:07 +00:00
Eli Friedman
d00fd2885e
Fix some casts to work without -flax-vector-conversions.
...
llvm-svn: 72981
2009-06-06 03:45:06 +00:00
Eli Friedman
ebd9314f32
Misc fixes to MMX/SSE intrinsics: a few small bug fixes, and getting rid
...
of calls to builtins for constructs which can be expressed directly.
llvm-svn: 72979
2009-06-06 02:13:04 +00:00
Eli Friedman
2696b1e25e
Default builtin creation to off; we don't really want to be doing it
...
without a relevant source location anyway. Fixes the issue with weird
warnings when including objc/Object.h on OS X.
llvm-svn: 72978
2009-06-06 02:08:44 +00:00
Mike Stump
dedc0968cf
Avoid warnings.
...
llvm-svn: 72976
2009-06-05 23:49:48 +00:00
Mike Stump
cbc2bcaf17
As an optimization, we maintain a cache of generated
...
___Block_byref_id_object_dispose and ___Block_byref_id_object_copy
functions so that we can simply reuse instead of creating a new one.
Additionally, add an assert to ensure no one yet tries to align a
__block variable beyond the alignment of a pointer as the codegen is
incomplete.
llvm-svn: 72974
2009-06-05 23:26:36 +00:00
Ted Kremenek
a03705c82d
Fix:
...
<rdar://problem/6948053> False positive: object substitution during -init* methods warns about returning +0 when using -fobjc-gc-only
llvm-svn: 72971
2009-06-05 23:18:01 +00:00
Ted Kremenek
ea1c221334
Enhance attribute cf_returns_retained to also work (in the analyzer)
...
for non-Objctive-C pointer types. This implicitly documents that the
return type is a CF object reference.
llvm-svn: 72968
2009-06-05 23:00:33 +00:00
Daniel Dunbar
feeeda70e2
weak_import should not make definitions have weak linkage.
...
- <rdar://problem/6948703> clang treats weak_import like weak
llvm-svn: 72967
2009-06-05 22:58:34 +00:00
Anton Korobeynikov
5bda50f84e
Update cmake script
...
llvm-svn: 72963
2009-06-05 22:08:54 +00:00
Anton Korobeynikov
244360d62b
Factor out TargetABIInfo stuff into separate file. No functionality change.
...
llvm-svn: 72962
2009-06-05 22:08:42 +00:00
Devang Patel
9e24386c65
Set function Attribute::NoImplicitFloat appropriately.
...
llvm-svn: 72961
2009-06-05 22:05:48 +00:00
Fariborz Jahanian
6845383426
Use of DeclContext for objc's ivars. No functionality
...
change. More to follow.
llvm-svn: 72951
2009-06-05 18:16:35 +00:00
Anders Carlsson
b3d05d6d11
Improvements to CXXExprWithTemporaries in preparation for fixing a bug with default arguments that have temporaries.
...
llvm-svn: 72944
2009-06-05 15:38:08 +00:00
Daniel Dunbar
4be99ff767
ABI handling: Fix nasty thinko where IRgen could generate an out-of-bounds read
...
when generating a coercion for ABI handling purposes.
- This may only manifest itself when building at -O0, but the practical effect
is that other arguments may get clobbered.
- <rdar://problem/6930451> [irgen] ABI coercion clobbers other arguments
llvm-svn: 72932
2009-06-05 07:58:54 +00:00
Eli Friedman
327f0b5593
Add driver support for -fsigned-char/-funsigned-char.
...
llvm-svn: 72930
2009-06-05 07:21:14 +00:00
Eli Friedman
9ffd4a9b96
Move CharIsSigned from TargetInfo to LangOptions.
...
llvm-svn: 72928
2009-06-05 07:05:05 +00:00
Eli Friedman
302c4e1683
Address review comments for #pragma weak.
...
llvm-svn: 72926
2009-06-05 06:28:29 +00:00
Anders Carlsson
184cb4123e
Make TemplateArgumentListBuilder take an ASTContext (because we're probably going to need it later). Move push_back to the .cpp file. If the passed in template argument is a type, assert that it's canonical.
...
llvm-svn: 72918
2009-06-05 05:31:27 +00:00
Anders Carlsson
c8e7113a9f
Make the TemplateArgumentList take a TemplateArgumentListBuilder.
...
llvm-svn: 72917
2009-06-05 04:47:51 +00:00
Anders Carlsson
1b28c3efe2
Change the specialization decls to take a TemplateArgumentListBuilder.
...
llvm-svn: 72916
2009-06-05 04:06:48 +00:00
Anders Carlsson
8aa89d4049
Add a helper class for building template argument lists.
...
llvm-svn: 72915
2009-06-05 03:43:12 +00:00
Anders Carlsson
03c9e87410
Fix another crash and actually make the test case work.
...
llvm-svn: 72913
2009-06-05 02:45:24 +00:00
Eli Friedman
5ed5198a5a
Start of a Sema implementation for #pragma weak. This isn't really the
...
right approach, but I'm still not sure what the best way to go about this is.
llvm-svn: 72912
2009-06-05 02:44:36 +00:00
Anders Carlsson
dd096d888b
Fix a case when the TemplateArgs vector can be empty.
...
llvm-svn: 72911
2009-06-05 02:12:32 +00:00
Daniel Dunbar
dd050567c1
Fix -Asserts build warnings.
...
llvm-svn: 72910
2009-06-05 02:03:25 +00:00
Douglas Gregor
b7ae10f764
Several improvements to template argument deduction:
...
- Once we have deduced template arguments for a class template partial
specialization, we use exactly those template arguments for instantiating
the definition of the class template partial specialization.
- Added template argument deduction for non-type template parameters.
- Added template argument deduction for dependently-sized array types.
With these changes, we can now implement, e.g., the remove_reference
type trait. Also, Daniel's Ackermann template metaprogram now compiles
properly.
llvm-svn: 72909
2009-06-05 00:53:49 +00:00
Eli Friedman
f5867dd51a
Add parser support for #pragma weak.
...
llvm-svn: 72907
2009-06-05 00:49:58 +00:00
Devang Patel
6e467b1a46
Set function attribute llvm::Attribute::NoRedZone appropriately.
...
llvm-svn: 72902
2009-06-04 23:32:02 +00:00
Eli Friedman
319ce956a9
Fix up this compatibility hack to be more compatible with gcc.
...
llvm-svn: 72901
2009-06-04 23:03:07 +00:00
Eli Friedman
fd4b1559db
Move a couple Darwin-specific defines into getDarwinDefines.
...
llvm-svn: 72900
2009-06-04 23:00:29 +00:00
Eli Friedman
fa90b154ca
Minor simplification.
...
llvm-svn: 72887
2009-06-04 20:23:20 +00:00
Eli Friedman
4a4fefcd29
PR4326: Handle constant evaluation for void* pointer subtraction
...
correctly.
llvm-svn: 72886
2009-06-04 20:04:03 +00:00
Fariborz Jahanian
7dae11446f
More refactoring/cleanup of objc ivars.
...
llvm-svn: 72871
2009-06-04 17:08:55 +00:00
Chris Lattner
0261e5c960
Make ReplaceUsesOfNonProtoTypeWithRealFunction verify that a call is *to* the
...
function of interest, not an operand of it.
llvm-svn: 72869
2009-06-04 16:47:43 +00:00
Chris Lattner
5e4702db61
DefineBuiltinMacro is always passed two args, remove the defaulted third
...
one.
llvm-svn: 72868
2009-06-04 16:47:09 +00:00
Torok Edwin
a1581e1a7a
forward -fno-color-diagnostics to clang-cc.
...
llvm-svn: 72856
2009-06-04 07:27:53 +00:00
Torok Edwin
c91b6e0ff8
Add ANSI color support for clang.
...
llvm-svn: 72855
2009-06-04 07:18:23 +00:00
Anders Carlsson
40f8f8d4d7
Minor improvements to template parameter writing.
...
llvm-svn: 72848
2009-06-04 05:37:43 +00:00
Douglas Gregor
6cc628edf4
Eliminate a warning
...
llvm-svn: 72846
2009-06-04 05:28:55 +00:00
Anders Carlsson
35533d11b3
Template argument deduction for incomplete and constant array types. Doug, please review.
...
llvm-svn: 72844
2009-06-04 04:11:30 +00:00
Anders Carlsson
43c52cdc29
Use PushConditionalTempDestruction/PopConditionalTempDestruction for the ternary operator.
...
llvm-svn: 72842
2009-06-04 03:00:32 +00:00
Anders Carlsson
f47a3de83c
Use conditional temp destruction for || and &&.
...
llvm-svn: 72838
2009-06-04 02:53:13 +00:00
Anders Carlsson
7d313fc09b
Make PushCXXTemporary and PopCXXTemporary handle conditional temporaries.
...
llvm-svn: 72837
2009-06-04 02:47:33 +00:00
Anders Carlsson
44bfcf0f97
Add PushConditionalTempDestruction/PopConditionalTempDestruction.
...
llvm-svn: 72835
2009-06-04 02:22:12 +00:00
Anders Carlsson
8936009a91
Make sure to call FullExpr before parsing anything else.
...
llvm-svn: 72834
2009-06-04 02:18:15 +00:00
Anders Carlsson
ea89e2b813
Make sure to push a cleanup block.
...
llvm-svn: 72831
2009-06-04 02:08:08 +00:00
Fariborz Jahanian
7c80959a97
Cleanup/Refactoring of ivar collection. No change in functionality.
...
llvm-svn: 72827
2009-06-04 01:19:09 +00:00
Douglas Gregor
5cdac0a52e
Template argument deduction for references
...
llvm-svn: 72822
2009-06-04 00:21:18 +00:00
Douglas Gregor
55ca8f6443
When performing template argument deduction, ensure that multiple
...
deductions of the same template parameter are equivalent. This allows
us to implement the is_same type trait (!).
Also, move template argument deduction into its own file and update a
few build systems with this change (grrrr).
llvm-svn: 72819
2009-06-04 00:03:07 +00:00
Mike Stump
fa0c645bae
Fix cmake builds.
...
llvm-svn: 72814
2009-06-03 22:24:28 +00:00
Eli Friedman
dd27484888
PR4316: Fix IRGen for cast-to-union extension.
...
llvm-svn: 72803
2009-06-03 20:45:06 +00:00
Anders Carlsson
4c49bb95f8
More temporary work.
...
llvm-svn: 72796
2009-06-03 19:05:16 +00:00
Eli Friedman
7c54f66058
PR4308: Fix support for -m32/-m64 on Linux.
...
I'll look into cleaning this up a bit as a followup.
llvm-svn: 72794
2009-06-03 18:59:56 +00:00
Anders Carlsson
6d36343ed8
Store more information about live temporaries. No functionality change for now.
...
llvm-svn: 72793
2009-06-03 18:54:26 +00:00
Anders Carlsson
82aea737a7
Move code generation of C++ temporaries into a new file.
...
llvm-svn: 72792
2009-06-03 18:40:21 +00:00
Daniel Dunbar
0c48b64807
(llvm up) Switch to using StandardPasses.h
...
- One functionality change, the LoopIndexSplit pass is now reenabled (it was
disabled in r60089 but we forgot to reenable it).
llvm-svn: 72787
2009-06-03 18:01:18 +00:00
Fariborz Jahanian
b68215c4de
Place the GC attribute on the same relative pointer
...
position to make it consistant and to match gcc's behavior,
by placing it at the inner-most pointer.
llvm-svn: 72784
2009-06-03 17:15:17 +00:00
Daniel Dunbar
877b30f83c
Driver: Support -mllvm; this just forwards options to clang-cc.
...
llvm-svn: 72780
2009-06-03 16:16:27 +00:00
Duncan Sands
f4063513d0
Compile fix needed by the solaris system gcc.
...
llvm-svn: 72772
2009-06-03 14:28:20 +00:00
Eli Friedman
aef810900a
Minor cleanup for implicit int warnings.
...
llvm-svn: 72770
2009-06-03 12:22:01 +00:00