]>
granicus.if.org Git - clang/log
Mike Stump [Tue, 17 Feb 2009 23:25:52 +0000 (23:25 +0000)]
Avoid getNameAsCString when the decl doesn't have a name.
Build of the parm list with the iterator, not end().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64851
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 23:20:26 +0000 (23:20 +0000)]
Rename UnaryTypeTraitExpr::Evaluate to EvaluateTrait to not collide
with Expr::Evaluate().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64850
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 23:20:10 +0000 (23:20 +0000)]
gcc spells it "warn_unused_result" (already supported) not "warnunusedresult"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64849
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 17 Feb 2009 23:15:12 +0000 (23:15 +0000)]
Implement basic parsing and semantic analysis for explicit
specialization of class templates, e.g.,
template<typename T> class X;
template<> class X<int> { /* blah */ };
Each specialization is a different *Decl node (naturally), and can
have different members. We keep track of forward declarations and
definitions as for other class/struct/union types.
This is only the basic framework: we still have to deal with checking
the template headers properly, improving recovery when there are
failures, handling nested name specifiers, etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64848
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 23:13:43 +0000 (23:13 +0000)]
ABITest: Add some checking of values for return types; useful for
catching internal consistency problems (esp. w/ reference compiler).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64847
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 23:12:22 +0000 (23:12 +0000)]
Note some more things to integrate into ABITest
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64846
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 22:47:27 +0000 (22:47 +0000)]
Eliminate dependency on where test is run from.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64837
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 17 Feb 2009 22:21:44 +0000 (22:21 +0000)]
BasicValueFactory: getMinValue/getMaxValue can be applied to any location type as specified by Loc::IsLocType().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64832
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 17 Feb 2009 22:20:20 +0000 (22:20 +0000)]
Attribute 'iboutlet' can be applied to Objective-C property declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64831
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 22:16:19 +0000 (22:16 +0000)]
Eek! getDeclAlign sometimes returned alignment in bits.
- Renamed to getDeclAlignInBytes since most other query functions
work in bits.
- Fun to track down as isIntegerConstantExpr was getting it right,
but Evaluate() was getting it wrong. Maybe we should assert they
compute the same thing when they succeed?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64828
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 22:14:32 +0000 (22:14 +0000)]
initial reimplement tgmath.h, written by Howard Hinnant!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64826
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 17 Feb 2009 21:45:36 +0000 (21:45 +0000)]
Simplified ExtQualType per Chris's feedback.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64820
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:46:25 +0000 (20:46 +0000)]
Remove one more redundant dyn_cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64808
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:26:05 +0000 (20:26 +0000)]
Move DeclContext::getParent and getLexicalParent in-line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64806
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:24:53 +0000 (20:24 +0000)]
Currently all DeclContexts are Decls as well; use cast<Decl> instead of dyn_cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64805
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:23:54 +0000 (20:23 +0000)]
Remove some redundant Decl -> Decl castings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64804
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:21:51 +0000 (20:21 +0000)]
Now that ObjC decls have DeclContexts too, remove an ugly hack from IdentifierResolver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64802
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 17 Feb 2009 20:20:37 +0000 (20:20 +0000)]
All Decls have a DeclContext now, hooray! Fans of consistency rejoice.
Pass the DeclContext to ObjCIvarDecls as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64801
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 17 Feb 2009 20:16:45 +0000 (20:16 +0000)]
Added support for objc's gc attribute in ExtQualType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64800
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 17 Feb 2009 19:53:58 +0000 (19:53 +0000)]
Convert tabs to spaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64799
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 19:47:34 +0000 (19:47 +0000)]
Backend: Accept -mcpu and -mattr for use by TargetMachine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64798
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 17 Feb 2009 19:29:07 +0000 (19:29 +0000)]
Enhance tests to exercise more combinations of using the RangeConstraintManager with the RegionStoreManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64788
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 17 Feb 2009 19:28:04 +0000 (19:28 +0000)]
Revised RangeConstraintManager based on several discussions with Ben Laurie and
Zhongxing Xu. The resultant code is less than 1/2 the size of the original.
Key highlights:
- All CouldBeXXX methods have been removed. Checking for feasibility is now just
done in the AddXXX methods.
- RangeSets now represent "all possible values" explicitly as the range set {
[min, max] } instead of the empty set. The empty set now represents "no
feasible values". This change consolidated much of the core algorithm to only
have one code path instead of alternate paths that considered the empty set to
represent "all possible falues."
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64787
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 17 Feb 2009 19:22:05 +0000 (19:22 +0000)]
BasicValueFactory: getMaxValue and getMinValue now also handle 'block' pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64786
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 19:02:12 +0000 (19:02 +0000)]
ccc: Pass -{MM,MMD,MF,MP,MT} to clang. Error on -{M,MM,MG,MQ} which
clang doesn't support yet.
- See PR3603.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64783
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 17 Feb 2009 18:51:14 +0000 (18:51 +0000)]
Proof that attribute __overloadable__ works as well as overloadable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64781
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 18:43:32 +0000 (18:43 +0000)]
Change EmitConstantExpr to allow failure.
IRgen no longer relies on isConstantInitializer, instead we just try
to emit the constant. If that fails then in C we emit an error
unsupported (this occurs when Sema accepted something that it doesn't
know how to fold, and IRgen doesn't know how to emit) and in C++ we
emit a guarded initializer.
This ends up handling a few more cases, because IRgen was actually
able to emit some of the constants Sema accepts but can't Evaluate().
For example, PR3398.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64780
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 18:31:04 +0000 (18:31 +0000)]
80-cols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64779
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 17 Feb 2009 18:27:45 +0000 (18:27 +0000)]
Renamed ASQualType to ExtQualType to reflect its more
general use; as for, objc2's gc type attributes. No
change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64778
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 18:10:48 +0000 (18:10 +0000)]
ccc: Recognize -isystem.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64776
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 18:10:15 +0000 (18:10 +0000)]
ccc: Assume gcc will accept piped assembler input when using generic GCC toolchain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64775
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 18:07:00 +0000 (18:07 +0000)]
ccc: Fix a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64774
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 17 Feb 2009 17:48:52 +0000 (17:48 +0000)]
Add '_assert' to list of known panic functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64772
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ben Laurie [Tue, 17 Feb 2009 17:33:31 +0000 (17:33 +0000)]
Don't include alloca.h if it doesn't exist.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64771
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ben Laurie [Tue, 17 Feb 2009 17:32:22 +0000 (17:32 +0000)]
Handle fatal errors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64770
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Tue, 17 Feb 2009 17:18:36 +0000 (17:18 +0000)]
Be sure to initialize Name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64769
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Tue, 17 Feb 2009 17:00:02 +0000 (17:00 +0000)]
Fixup spacing a little.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64768
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 17 Feb 2009 16:03:01 +0000 (16:03 +0000)]
Remove the error about redefining library functions. It's causing too
much pain when compiling the Linux kernel (PR3592).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64767
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 15:49:03 +0000 (15:49 +0000)]
Grammar tweak.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64765
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 08:44:50 +0000 (08:44 +0000)]
As an experimental hack, emit "instantiated from" information in
diagnostics. I'm not sure I want to keep this, but hey, it's easy
and could be useful or something, even if guarded by a
-fshow-me-tons-of-details option. A silly example is:
#define A B
#define C A
#define D C
int y = D;
We now emit:
t.c:11:9: error: use of undeclared identifier 'B'
int y = D;
^
t.c:9:11: note: instantiated from:
#define D C
^
t.c:8:11: note: instantiated from:
#define C A
^
t.c:7:11: note: instantiated from:
#define A B
^
A more useful example is from tgmath:
t.c:4:9: error: no matching function for call to '__tg_acos'
return acos(x);
^~~~~~~
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:51:17: note: instantiated from:
#define acos(x) __tg_acos(x)
^
... candidate set follows ...
This does not yet print ranges in instantiation info, (e.g. highlighting the
range "__tg_acos(x)" in the last example), but that could be added if we
decide this is a good idea :).
Thoughts and bug reports welcome!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64761
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 08:39:06 +0000 (08:39 +0000)]
add an accessor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64760
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 08:12:06 +0000 (08:12 +0000)]
emit:
t.c:4:9: error: invalid type 'short *' to __real operator
__tg_choose (__real__(z), C##f(z), (C)(z), C##l(z)),
^
instead of:
t.c:4:9: error: invalid type 'short *' to __real or __imag operator
__tg_choose (__real__(z), C##f(z), (C)(z), C##l(z)),
^
fixing a fixme. It would be even fancier to get the spelling of the token, but I
don't care *that* much :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64759
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 08:04:48 +0000 (08:04 +0000)]
add an accessor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64758
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 07:57:58 +0000 (07:57 +0000)]
Spell __always_inline__ correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64757
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 07:55:55 +0000 (07:55 +0000)]
x86_64 ABI: Fix assert on return of _Complex long double.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64756
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 07:54:55 +0000 (07:54 +0000)]
sink a call to getInstantiationLoc to eliminate an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64755
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 07:51:53 +0000 (07:51 +0000)]
break down EmitCaretDiagnostic to use more primitive calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64754
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 17 Feb 2009 07:47:57 +0000 (07:47 +0000)]
Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64753
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 07:40:10 +0000 (07:40 +0000)]
add some files to fix the cmake build, patch by Piotr Rak!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64752
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 07:38:37 +0000 (07:38 +0000)]
split caret diagnostic printing out into its own function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64751
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 07:34:34 +0000 (07:34 +0000)]
simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64750
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 07:29:20 +0000 (07:29 +0000)]
remove "; candidates are/is:" from various ambiguity diagnostics.
2 out of 2 people on irc prefer them gone :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64749
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 07:07:29 +0000 (07:07 +0000)]
clarify the behavior of note.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64748
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 06:52:20 +0000 (06:52 +0000)]
fix a minor bug with my previous patch
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64747
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 06:49:55 +0000 (06:49 +0000)]
fix notes so that they are always filtered with the same logic
as the last non-note diagnostic that preceeded them. This ensures
that diagnostics in main files which have notes with locations in
system headers get all the bits and pieces emitted or not in a
unit. This fixes PR3215.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64746
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 05:19:10 +0000 (05:19 +0000)]
If a source range comes through a function-like macro expansion,
highlight the arguments to the macro as well as the identifier.
Before:
t.c:3:9: error: no matching function for call to '__tg_acos'; candidates are:
return acos(x);
^~~~
after:
t.c:3:9: error: no matching function for call to '__tg_acos'; candidates are:
return acos(x);
^~~~~~~
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64743
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 17 Feb 2009 05:01:10 +0000 (05:01 +0000)]
Fix broken line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64740
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 17 Feb 2009 04:27:41 +0000 (04:27 +0000)]
Static Analyzer driver/options (partial) cleanup:
- Move all analyzer options logic to AnalysisConsumer.cpp.
- Unified specification of stores/constraints/output to be:
-analyzer-output=...
-analyzer-store=...
-analyzer-constraints=...
instead of -analyzer-range-constraints, -analyzer-store-basic, etc.
- Updated drivers (ccc-analyzer, scan-builds, new ccc) to obey this new
interface
- Updated test cases to conform to new driver options
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64737
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 17 Feb 2009 03:23:10 +0000 (03:23 +0000)]
Static variables and functions won't collide with standard library
functions, so if we're declaring a static we should implicitly declare
a library function by the same name (e.g., malloc, strdup). Fixes PR3592.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64736
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 17 Feb 2009 03:05:04 +0000 (03:05 +0000)]
Add SSSE3 header
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64735
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 02:45:44 +0000 (02:45 +0000)]
x86_64 ABI: Implement classification for bit-fields.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64727
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 02:42:31 +0000 (02:42 +0000)]
remove dead macros
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64725
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 02:41:36 +0000 (02:41 +0000)]
explicitly cast integers to double. This a) silences any
possible future "data loss" warnings, and b) makes it intensely
obvious to the user what the impl of these functions do in a
ambiguity error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64724
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 02:37:35 +0000 (02:37 +0000)]
asin support. No we don't care about complex int :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64723
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 02:30:54 +0000 (02:30 +0000)]
hand macro expand this to make "candidate" set printing more useful. However,
Now no candidates are printed because the 'notes' are in a system header. :(
#include <tgmath-sofar.h>
double foo2(short *x) {
return acos(x);
}
t.c:10:10: error: no matching function for call to '__tg_acos'; candidates are:
return acos(x);
^~~~
1 diagnostic generated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64722
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 02:22:33 +0000 (02:22 +0000)]
add support for integers to tgmath functions. I apparently need to provide
all the integer types other than char/short to avoid overload ambiguities.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64721
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 02:14:31 +0000 (02:14 +0000)]
start converting over to attr(overloadable). Unfortunately, this
produces really horrible diagnostics when overload ambiguities
happen:
t.c:10:10: error: call to '__tg_acos' is ambiguous; candidates are:
return acos(x);
^~~~
In file included from t.c:1:
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^
/Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:49:1: note: candidate function
__TG_RC_1(x, acos, cacos)
^
A possible fix is to just not use macros for this, which I'll probably go for,
but it would be nice to emit the type at the call, so we know what we asked for!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64720
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 01:09:29 +0000 (01:09 +0000)]
Make PragmaPackStack be a private class in SemaAttr and make its
instance in Sema be a pimpl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64718
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 17 Feb 2009 01:05:43 +0000 (01:05 +0000)]
Added ClassTemplateSpecializationDecl, which is a subclass of
CXXRecordDecl that is used to represent class template
specializations. These are canonical declarations that can refer to
either an actual class template specialization in the code, e.g.,
template<> class vector<bool> { };
or to a template instantiation. However, neither of these features is
actually implemented yet, so really we're just using (and uniqing) the
declarations to make sure that, e.g., A<int> is a different type from
A<float>. Note that we carefully distinguish between what the user
wrote in the source code (e.g., "A<FLOAT>") and the semantic entity it
represents (e.g., "A<float, int>"); the former is in the sugared Type,
the latter is an actual Decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64716
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 00:58:30 +0000 (00:58 +0000)]
copying and assignment of sema seem unwise :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64712
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 00:57:29 +0000 (00:57 +0000)]
move attribute(packed) sema support out of SemaDecl into a new SemaAttr.cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64711
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 00:51:07 +0000 (00:51 +0000)]
simplify this code and make it use highlight range. This
makes -emit-html do nice things for code like:
#define FOO(X) y
int FOO(4
);
highlighting the FOO instance as well as the ) on the next line properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64710
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 17 Feb 2009 00:42:05 +0000 (00:42 +0000)]
ccc: Pass -f[no-]math-errno to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64709
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 00:35:09 +0000 (00:35 +0000)]
add support for -fno-math-errno, and validate that it affects sema properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64708
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 00:32:04 +0000 (00:32 +0000)]
sema no longer explodes, yay!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64707
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 17 Feb 2009 00:30:31 +0000 (00:30 +0000)]
remove extraneous .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64706
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 16 Feb 2009 23:38:56 +0000 (23:38 +0000)]
x86_64 ABI: Handle va_arg arguments with alignment > 8.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64701
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 16 Feb 2009 23:37:57 +0000 (23:37 +0000)]
Diagnose non-power-of-2 arguments to attribute aligned.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64700
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Mon, 16 Feb 2009 22:59:18 +0000 (22:59 +0000)]
Add support for throwing exceptions to the nonfragile ABI
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64692
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 16 Feb 2009 22:52:32 +0000 (22:52 +0000)]
Added implementation of objc2's gc API calls for
nonfragile abi.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64690
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 16 Feb 2009 22:43:43 +0000 (22:43 +0000)]
Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow.
- Define pow[lf]?, sqrt[lf]? as builtins.
- Add -fmath-errno option which binds to LangOptions.MathErrno
- Add new builtin flag Builtin::Context::isConstWithoutErrno for
functions which can be marked as const if errno isn't respected for
math functions. Sema automatically marks these functions as const
when they are defined, if MathErrno=0.
- IRgen uses const attribute on sqrt and pow library functions to
decide if it can use the llvm intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64689
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 16 Feb 2009 22:42:44 +0000 (22:42 +0000)]
Unbreak clang.
Doug: please verify that it is expected that LastIdx can be less that
NumInits. And perhaps add a comment so that Chris doesn't break your
code. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64688
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 16 Feb 2009 22:38:20 +0000 (22:38 +0000)]
Make "implicit int" an error in C++ (unless we're allowing Microsoft
extensions). This caught a couple bugs in our test suite :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64686
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 16 Feb 2009 22:33:34 +0000 (22:33 +0000)]
fix long lines.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64684
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 16 Feb 2009 22:25:49 +0000 (22:25 +0000)]
fix volatile handling with ExtVectorElementExpr, so that we
emit two volatile loads for:
typedef __attribute__(( ext_vector_type(4) )) float float4;
float test(volatile float4 *P) {
return P->x+P->y;
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64683
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 16 Feb 2009 22:21:33 +0000 (22:21 +0000)]
Modify getMaxValue/getMinValue to take pointer values as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64682
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 16 Feb 2009 22:14:05 +0000 (22:14 +0000)]
introduce and use a new ExtVectorElementExpr::isArrow method, at Eli's suggestion
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64681
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 16 Feb 2009 22:09:26 +0000 (22:09 +0000)]
Use isa<...> instead of dyn_cast<...> where result is not needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64680
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 16 Feb 2009 22:07:16 +0000 (22:07 +0000)]
diagnose uses of deprecated typenames and tags.
We now pass all the deprecation tests in the objc.dg suite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64679
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 16 Feb 2009 22:07:07 +0000 (22:07 +0000)]
BasicValueFactory: Add utility methods 'Add1' and 'Sub1' to get a persistent APSInt value that is 1 greater or 1 less than the provided value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64678
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 16 Feb 2009 22:00:30 +0000 (22:00 +0000)]
BasicValueFactory: Add getMaxValue and getMinValue variants that take QualTypes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64677
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 16 Feb 2009 21:58:21 +0000 (21:58 +0000)]
Supply the header corresponding to a library builtin as a separate argument to the LIBBUILTIN macro
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64676
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 16 Feb 2009 21:57:23 +0000 (21:57 +0000)]
Add getSymbolManager() and getBasicVals() accessors to GRStateRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64675
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 16 Feb 2009 21:52:05 +0000 (21:52 +0000)]
Fix IRgen of __builtin_memset.
- Fix test case to not only have negative tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64674
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 16 Feb 2009 21:43:00 +0000 (21:43 +0000)]
random cleanup
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64673
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 16 Feb 2009 21:41:04 +0000 (21:41 +0000)]
Fixes a bug in property type encoding.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64672
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 16 Feb 2009 21:33:09 +0000 (21:33 +0000)]
warn about interfaces that inherit from deprecated classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64671
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 16 Feb 2009 21:30:01 +0000 (21:30 +0000)]
warn about categories that implement deprecated interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64670
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 16 Feb 2009 21:26:43 +0000 (21:26 +0000)]
early exit on error. This code is creating an invalid decl on error. This is
dubious, but at least mark it as an invalid decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64668
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 16 Feb 2009 21:11:58 +0000 (21:11 +0000)]
enhance ExtVectorElementExpr to allow V->xxyy to work like (*V).xxyy
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64667
91177308 -0d34-0410-b5e6-
96231b3b80d8