Commit Graph

503 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Eli Friedman ebb9e4dc4d Minor tweaks to the Windows target.
llvm-svn: 73083
2009-06-08 21:16:17 +00:00
Eli Friedman cf432d3c7b PR4346: add "R" asm register constraint.
llvm-svn: 73081
2009-06-08 20:45:44 +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
Zhongxing Xu aaa86d07a0 Remove dead code: 'NewEntry' is not used.
llvm-svn: 73027
2009-06-07 11:18: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 fd4b1559db Move a couple Darwin-specific defines into getDarwinDefines.
llvm-svn: 72900
2009-06-04 23:00:29 +00:00
Eli Friedman 3d2c8fd3a6 Back out r72764; I should have looked more carefully before committing
this.  The correct replacement for "Y" and "Yt" is "x".

llvm-svn: 72765
2009-06-03 10:41:42 +00:00
Eli Friedman ffc8748faa PR3678: Add support for "Yt" asm register constraint.
llvm-svn: 72764
2009-06-03 10:33:05 +00:00
Sanjiv Gupta 7c72007e2a Add floating point details to PIC16 Target.
llvm-svn: 72713
2009-06-02 04:43:46 +00:00
Eli Friedman 20da71e3b6 Add a couple missing ARM defines.
llvm-svn: 72583
2009-05-29 19:00:15 +00:00
Eli Friedman 7942674be0 A few more tweaks for Solaris; please correct me if it's wrong somehow.
llvm-svn: 72240
2009-05-22 01:12:57 +00:00
Douglas Gregor 4871c4739d Improve target support for Solaris.
llvm-svn: 72237
2009-05-21 23:51:30 +00:00
Daniel Dunbar 70f924df8a Avoid potential out-of-bounds access in SourceManager::getLineNumber.
- Chris, please see added FIXMEs.

llvm-svn: 72019
2009-05-18 17:30:52 +00:00
Eli Friedman 678d3bac03 Targets without long long should reduce the size of intmax_t
accordingly.

llvm-svn: 71966
2009-05-16 23:30:57 +00:00
Anton Korobeynikov 2f910827eb Provide dummy va_list typedef for msp430
llvm-svn: 71233
2009-05-08 18:24:57 +00:00
Daniel Dunbar f9d90275f9 Handle -march for the LLVM recognized cpu names.
- x86 target feature handling should not be feature complete, even if
   the code quality is lacking.

llvm-svn: 71123
2009-05-06 21:56:32 +00:00
Daniel Dunbar bb36aed06b More x86 target feature support.
- Apologies for the extremely gross code duplication, I want to get
   this working and then decide how to get this information out of the
   back end.

 - This replaces -m[no-]sse4[12] by -m[no-]sse4, it appears gcc
   doesn't distinguish them?

 - -msse, etc. now properly disable/enable related features.

 - Don't always define __SSE3__...

 - The main missing functionality bit here is that we don't initialize
   the features based on the CPU for all -march options.

llvm-svn: 71117
2009-05-06 21:07:50 +00:00
Daniel Dunbar e5ae096bf8 Tweak x86 -mcpu defaults.
- Default to yonah on Darwin (to get SSE3).

 - Default to Pentium4 (32-bit) and x86-64 (64-bit) on
   non-Darwin. Welcome to the 21st century.

llvm-svn: 71069
2009-05-06 04:58:14 +00:00
Chris Lattner dbcc5ca57f Fix rdar://6860124 - invalid input constraint 'J' in asm
This recognizes all the target-independent constant constraints
that have target-specific meanings.

llvm-svn: 71064
2009-05-06 04:33:31 +00:00
Daniel Dunbar 4dbaaa6f43 Improve handling of (X86) target features.
- This is a WIP...

 - This adds -march= handling to the driver, and fixes the defaulting
   of -mcpu on Darwin (which was using the wrong test).

Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
 -target-feature [+-]name

In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.

This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.

llvm-svn: 71061
2009-05-06 03:16:41 +00:00
Anton Korobeynikov a0f5437c03 Hook msp430 in
llvm-svn: 70774
2009-05-03 13:43:08 +00:00
Anton Korobeynikov 9d026dd985 Whitespace cleanup
llvm-svn: 70773
2009-05-03 13:42:53 +00:00
Chris Lattner 195f88386c when creating custom warning diagnostics, do not attempt to map
them with -Werror.  Custom diags cannot be mapped, and this makes
-Werror cause a determinstic crash for the checker and other
clients of the custom diagnostics machinery.  rdar://6816191

llvm-svn: 70639
2009-05-02 19:34:21 +00:00
Eli Friedman 2b680b43e9 Simplify the scheme used for keywords, and change the classification
scheme to be more useful.

The new scheme introduces a set of categories that should be more 
readable, and also reflects what we want to consider as an extension 
more accurately.  Specifically, it makes the "what is a keyword" 
determination accurately reflect whether the keyword is a GNU or 
Microsoft extension.

I also introduced separate flags for keyword aliases; this is useful 
because the classification of the aliases is mostly unrelated to the 
classification of the original keyword.

This patch treats anything that's in the implementation 
namespace (prefixed with "__", or "_X" where "X" is any upper-case 
letter) as a keyword without marking it as an extension.  This is 
consistent with the standards in that an implementation is allowed to define 
arbitrary extensions in the implementation namespace without violating 
the standard. This gets rid of all the nasty "extension used" warnings 
for stuff like __attribute__ in -pedantic mode.  We still warn for 
extensions outside of the the implementation namespace, like typeof.
If someone wants to implement -Wextensions or something like that, we 
could add additional information to the keyword table.

This also removes processing for the unused "Boolean" language option; 
such an extension isn't supported on any other C implementation, so I 
don't see any point to adding it.

The changes to test/CodeGen/inline.c are required because previously, we 
weren't actually disabling the "inline" keyword in -std=c89 mode.

I'll remove Boolean and NoExtensions from LangOptions in a follow-up 
commit.

llvm-svn: 70281
2009-04-28 03:13:54 +00:00
Douglas Gregor 0bc1293584 Be more careful in our teardown of the PCHReader after deciding to
ignore a PCH file.

llvm-svn: 70251
2009-04-27 21:28:04 +00:00
Douglas Gregor c504683237 Implement caching of stat() calls for precompiled headers, which is
essentially the same thing we do with pretokenized headers. stat()
caching improves performance of the Cocoa-prefixed "Hello, World" by
45%.

llvm-svn: 70223
2009-04-27 18:38:38 +00:00
Douglas Gregor 258ae54a5d Load most of the source manager's information lazily from the PCH
file. In particular, only eagerly load source location entries for
files and for the predefines buffer. Other buffers and
macro-instantiation source location entries are loaded lazily.

With the Cocoa-prefixed "Hello, World", we only load 815/26555 source
location entities. This halves the amount of user time we spend in
this "Hello, World" program with -fsyntax-only (down to .007s).

This optimization is part 1 of 2 for the source manager. This
eliminates most of the user time in loading a PCH file. We still spend
too much time initialize File structures (especially in the calls to
stat), so we need to either make the loading of source location
entries for files lazy or import the stat cache from the PTH
implementation.

llvm-svn: 70196
2009-04-27 06:38:32 +00:00
Douglas Gregor 70091b8f43 Some fixes for PCH (de-)serialization of Objective-C AST nodes:
- Deal with the Receiver/ClassInfo shared storage in ObjCMessageExpr
  - Implement PCH support for ImplicitParamDecl
  - Fix the handling of the body of an ObjCMethodDecl
  - Several cast -> cast_or_null fixes
  - Make Selector::getIdentifierInfoForSlot work for 1-argument, NULL
  selectors.
  - Make Selector::getAsString() work with NULL selectors.
  - Fix the names of VisitObjCAtCatchStmt and VisitObjCAtFinallyStmt
  in the PCH reader and writer; these were never getting called.

At this point, all of the pch-test tests pass for C and Objective-C.

llvm-svn: 70163
2009-04-26 22:20:50 +00:00
Chris Lattner 4c92b51089 in a tied operand, don't copy over the name or constraint string, just the flags.
llvm-svn: 70137
2009-04-26 18:05:25 +00:00
Chris Lattner c16d476b30 pull operands names "[foo]" into ConstraintInfo.
llvm-svn: 70136
2009-04-26 17:57:12 +00:00
Chris Lattner c3f4c7b1c5 pull the constraint string into the ConstraintInfo struct
instead of passing it around in addition to it.

llvm-svn: 70135
2009-04-26 17:19:08 +00:00
Chris Lattner d9725f7041 change TargetInfo::ConstraintInfo to be a struct that contains
the enum along with some other data.

llvm-svn: 70114
2009-04-26 07:16:29 +00:00
Douglas Gregor 99734e7669 Lazily load the controlling macros for all of the headers known in the
PCH file. In the Cocoa-prefixed "Hello, World" benchmark, this takes
us from reading 503 identifiers down to 37 and from 470 macros down to
4. It also results in an 8% performance improvement.

llvm-svn: 70094
2009-04-25 23:30:02 +00:00
Chris Lattner 0dc102624f some arm triples have weird characters in them, just fuzzy match
on armv* to be more compatible

llvm-svn: 69864
2009-04-23 04:22:04 +00:00
Douglas Gregor 48db39dc90 Remove the serialization code that predates precompiled
headers. Future approaches to (de-)serializing ASTs will be based on
the PCH infrastructure.

llvm-svn: 69828
2009-04-22 21:45:53 +00:00
Chris Lattner 63660175f8 Add missing dependency, patch by Jason Haslam!
llvm-svn: 69819
2009-04-22 18:59:57 +00:00
Sanjiv Gupta 4c5dfd3c45 Pass and return aggregate types directly to function calls.
llvm-svn: 69668
2009-04-21 06:01:16 +00:00
Daniel Dunbar 69a79b1a60 Don't crash in the diagnostic printer if we happen to get passed a
null string / identifier.

llvm-svn: 69575
2009-04-20 06:13:16 +00:00
Chris Lattner c6fafed04c move group twiddling options into Diagnostic.cpp instead of
Warnings.cpp.  Warnings.cpp now doesn't need to #include
tblgen produced output directly.

llvm-svn: 69559
2009-04-19 22:34:23 +00:00
Eli Friedman d88c8a104f Add target property for whether thread-local storage is supported.
Let me know if I messed up for some target.  Note that for Windows, we 
should be able to support it (MSVC supports "__declspec(thread)"), but 
I'm pretty sure LLVM doesn't know how to generate the correct code.

llvm-svn: 69552
2009-04-19 21:38:35 +00:00
Chris Lattner 6df41af7fb actually just do this on all x86 targets, it won't hurt
non-glibc ones.

llvm-svn: 69528
2009-04-19 17:32:33 +00:00
Chris Lattner 4997b8ef98 Define __NO_MATH_INLINES on linux/x86 so that we don't get inline
functions in glibc header files that use FP Stack inline asm which the
backend can't deal with (PR879).

This "fixes" PR3970 for linux.  Other affected systems should do similar
things.  Maybe this should just go to the general i386/x86-64 sections?

llvm-svn: 69527
2009-04-19 17:29:50 +00:00
Chris Lattner 2d49eed816 optimize and comment GetDiagInfo.
llvm-svn: 69273
2009-04-16 06:13:46 +00:00
Chris Lattner 6c440329f1 merge several scattered tables into StaticDiagInfo.
llvm-svn: 69272
2009-04-16 06:07:15 +00:00
Chris Lattner 6a64cc6776 Implement Diagnostic::getWarningOptionForDiag with information from tblgen,
this implements -fdiagnostics-show-option in clang-cc.

llvm-svn: 69271
2009-04-16 06:00:24 +00:00
Chris Lattner a538967177 tblgen is now passing diagnostic group information in the .inc file, ignore it everywhere.
llvm-svn: 69269
2009-04-16 05:52:14 +00:00
Chris Lattner 22cb818913 implement framework for -fdiagnostics-show-option, but tblgen isn't
passing down the right info yet.

llvm-svn: 69268
2009-04-16 05:44:38 +00:00
Chris Lattner b8e73158e1 move handling of -pedantic and -pedantic-errors into Diagnostics,
out of Warnings.cpp.  This simplifies warnings.cpp and makes it more
efficient.

llvm-svn: 69266
2009-04-16 05:04:32 +00:00
Chris Lattner f9150bac01 arrange for -Wno-error=foo warnings to be immune to -Werror as
they are supposed to be.

llvm-svn: 69265
2009-04-16 04:32:54 +00:00
Chris Lattner 411c0ffe5d change mappings to distinguish between "unset", "set by the user" and
"set to the default value".

llvm-svn: 69264
2009-04-16 04:12:40 +00:00
Chris Lattner d9ecb8e279 fix some out of bounds array access problems, which manifest particularly
spectacularly when built for x86-64.

llvm-svn: 69197
2009-04-15 18:48:23 +00:00
Chris Lattner 2fe292076e move {'s
llvm-svn: 69179
2009-04-15 17:13:42 +00:00
Chris Lattner e6c831deb2 Make diagnostic class explicit in the diag record instead of
implicit from its parenting.  Now that diag mapping is 
explicit, eliminate the fatal and extwarn classes.

llvm-svn: 69177
2009-04-15 16:56:26 +00:00
Chris Lattner 1b595624a8 Tblgen now passes the default mapping explicitly, instead of having it
be tied to the diag class.  This requires an LLVM tree update.

llvm-svn: 69175
2009-04-15 16:44:12 +00:00
Chris Lattner e007de3b9a Rejigger how -pedantic and -pedantic-errors work and their interaction
with other diagnostic mapping.  In the new scheme, -Wfoo or -Wno-foo or 
-Werror=foo all override the -pedantic options, and __extension__ 
robustly silences all extension diagnostics in their scope.

An added bonus of this change is that MAP_DEFAULT goes away, meaning that
per-diagnostic mapping information can now be stored in 2 bits, doubling
the density of the Diagnostic::DiagMapping array.  This also 
substantially simplifies Diagnostic::getDiagnosticLevel.

OTOH, this temporarily introduces some "macro intensive" code in 
Diagnostic.cpp.  This will be addressed in a later patch.

llvm-svn: 69154
2009-04-15 07:01:18 +00:00
Mike Stump d73e4419f5 Fixup whitespacing.
llvm-svn: 69055
2009-04-14 18:24:37 +00:00
Douglas Gregor 4c7626e7b6 Include the SourceManager's line table in the PCH file. We can now
properly cope with #line directives in PCH files.

llvm-svn: 68963
2009-04-13 16:31:14 +00:00
Douglas Gregor a07ebc5b95 Factor the internals of SourceManager (specially, LineTableInfo) into a separate Internals header. No functionality change
llvm-svn: 68960
2009-04-13 15:31:25 +00:00
Daniel Dunbar 497ff13243 Support -miphoneos-version-min in clang-cc.
- Patch by Shantonu Sen (with a minor tweak to split out
   getDarwin{OSX,IPhoneOS}Defines)!

 - <rdar://problem/6776277> Need clang-cc/ccc-analyzer support for
   -miphoneos-version-min

llvm-svn: 68815
2009-04-10 19:52:24 +00:00
Chris Lattner 14a7f39733 Add initial support for -imacros. Right now it has the same semantics as
-include, but that will be fixed soon.

llvm-svn: 68625
2009-04-08 18:24:34 +00:00
Chris Lattner 8bc98d9bed remove fixme!
llvm-svn: 68589
2009-04-08 03:47:39 +00:00
Mike Stump 9d54bd77c0 Add basic support for arm static analysis checking. Radar 6699395
llvm-svn: 68582
2009-04-08 02:07:04 +00:00
Chris Lattner 2a5c0a3688 Fariborz points out that weak is now defined to the attribute even
in C mode.

llvm-svn: 68520
2009-04-07 16:50:40 +00:00
Chris Lattner c2d140156c The __weak and __strong defines are common to all darwin targets
and are even set in C mode.  As such, move them to Targets.cpp.

__OBJC_GC__ is also darwin specific, but seems reasonable to always
define it when in objc-gc mode.

This fixes rdar://6761450

llvm-svn: 68494
2009-04-07 04:48:21 +00:00
Anton Korobeynikov 6953ef2de3 Provide sema proper values of maximal number of arguments passed in registers.
llvm-svn: 68413
2009-04-03 23:38:25 +00:00
Daniel Dunbar fd6cfcffa2 Add target hook for setting symbol prefix and section of unicode
string literals.

llvm-svn: 68363
2009-04-03 00:57:44 +00:00
Douglas Gregor 0f4cc3f728 Fix a little typo that was killing de-serialization
llvm-svn: 68354
2009-04-03 00:25:09 +00:00
Douglas Gregor 17bbaed164 Resynchronize Decl/VarDecl serialization code with the structures
llvm-svn: 68346
2009-04-02 23:40:00 +00:00
Steve Naroff 29cae66bde Add ConvertUTF module from http://www.unicode.org/Public/PROGRAMS/CVTUTF.
#ifdef'd out the 5 conversion routines that we don't currently need.

Still need a bit more work in GetAddrOfConstantCFString(). Added a FIXME to indicate this.

Expect to remove the FIXME today...

llvm-svn: 68208
2009-04-01 15:50:34 +00:00
Daniel Dunbar 08b216abf1 Add Target hooks for IRgen of [cf]string literals.
- Notably, set section on cfstring literal string data (for now, this
   is done everywhere because it matches what we were already doing
   for the CFString data itself)

 - <rdar://problem/6599098> [irgen] linker requires objc string data
   to go into cstring

llvm-svn: 68160
2009-03-31 23:42:16 +00:00
Eli Friedman 32ca82a450 Fix the default for intptr_t on *BSD x86-32 and Windows. Slight cleanup
by moving the general case to the generic x86-32 target.

llvm-svn: 68015
2009-03-29 20:31:09 +00:00
Daniel Dunbar c53305fd42 Ad FreeBSD ARM target info.
- Patch by Ed Schoeten!

llvm-svn: 67527
2009-03-23 16:09:04 +00:00
Douglas Gregor da17bd34e7 Eliminate post-diagnostic hooks. Instead, implement a Sema-specific
variant of DiagnosticBuilder that emits the template instantiation
backtrace when needed.

llvm-svn: 67413
2009-03-20 22:48:49 +00:00
Chris Lattner 1e1c0b9fd3 refactor some code, fixing a problem discovered by the dragonfly bsd people, where
clang was defining "i386" even when in non-gnu mode.

llvm-svn: 67378
2009-03-20 16:06:38 +00:00
Chris Lattner a1321f1632 pass langoptions around.
llvm-svn: 67376
2009-03-20 15:55:34 +00:00
Chris Lattner 4ba73aa0c2 pass LangOptions into TargetInfo::getTargetDefines, so that targets
can have language-specific defines.

llvm-svn: 67375
2009-03-20 15:52:06 +00:00
Sebastian Redl 90b6edda75 Bindir and Win32 builds work, so switch to .inc files. Leave the .def files in the tree for a day or so longer.
llvm-svn: 67346
2009-03-19 23:18:26 +00:00
Douglas Gregor 19367f54e2 Allow notes to be printed following a fatal error, then suppress any
diagnostics following those notes. 

Make exceeding the template instantiation depth a fatal error.

Thanks to Daniel for pointing out the problem!

llvm-svn: 67320
2009-03-19 18:55:06 +00:00
Douglas Gregor 23d75bb326 Build system changes to use TableGen to generate the various
diagnostics. This builds on the patch that Sebastian committed and
then revert. Major differences are:

  - We don't remove or use the current ".def" files. Instead, for now,
    we just make sure that we're building the ".inc" files.
  - Fixed CMake makefiles to run TableGen and build the ".inc" files
    when needed. Tested with both the Xcode and Makefile generators
    provided by CMake, so it should be solid.
  - Fixed normal makefiles to handle out-of-source builds that involve
    the ".inc" files.

I'll send a separate patch to the list with Sebastian's changes that
eliminate the use of the .def files.

llvm-svn: 67058
2009-03-16 23:06:59 +00:00
Sebastian Redl 4ae9b126fe Revert the switch to the tablegen diags. It fails for seperate objdir builds and cmake builds, and I have no clue what to do about it. Revisit this after someone with a clue about the build systems has looked at it.
llvm-svn: 67009
2009-03-14 15:58:54 +00:00
Sebastian Redl 51e037e3c4 Switch diagnostics from .def to tablegen files. Please validate the Windows build.
llvm-svn: 67007
2009-03-14 12:00:12 +00:00
Daniel Dunbar 4f495980c4 Add Diagnostic files for Frontend and move a couple errors over.
- Notably, clang now exits with an error if it can't find a
   file. This flushed out a bug in the CGColorSpace.c test case. :)

llvm-svn: 66789
2009-03-12 10:14:16 +00:00
Daniel Dunbar c0b3e95a1a Driver: Use standard Diagnostic interface for diagnostics.
llvm-svn: 66786
2009-03-12 08:55:43 +00:00
Chris Lattner 1ac3c9292f Clear all the linetable state in clear(), fixing problems
with "clang t.i s.i" where the .i files contain line markers.
rdar://6667812

llvm-svn: 66619
2009-03-11 01:09:52 +00:00
Douglas Gregor 4ea568f213 Add a notion of "post-diagnostic hooks", which are callbacks attached
to a diagnostic that will be invoked after the diagnostic (if it is
not suppressed). The hooks are allowed to produce additional
diagnostics (typically notes) that provide more information. We should
be able to use this to help diagnostic clients link notes back to the
diagnostic they clarify. Comments welcome; I'll write up documentation
and convert other clients (e.g., overload resolution failures) if
there are no screams of protest.

As the first client of post-diagnostic hooks, we now produce a
template instantiation backtrace when a failure occurs during template
instantiation. There's still more work to do to make this output
pretty, if that's even possible.

llvm-svn: 66557
2009-03-10 18:03:33 +00:00
Daniel Dunbar 4095d89532 Remove some now-unneeded calls to llvm::errs().flush().
llvm-svn: 66555
2009-03-10 18:00:19 +00:00
Ted Kremenek 3ceb7caf1c Add FullSourceLoc::getDecomposedLoc.
llvm-svn: 66522
2009-03-10 05:13:43 +00:00
Ted Kremenek 22988cf493 Revert my last couple patches until I can get them to not make the tests fail.
llvm-svn: 66317
2009-03-07 01:47:10 +00:00
Ted Kremenek a44b4f987c Teach Diagnostic about Selector.
llvm-svn: 66314
2009-03-07 01:36:13 +00:00
Ted Kremenek 0666a6ce70 Selector: (changes made after discussing this more with Steve Naroff)
- Make Selector::getAsIdentifierInfo() private.  Using IdentifierInfo* in
  Selector is an implementation detail that clients shouldn't think about.
- Modify diagnostic emission in Sema::ProcessPropertyDecl to not use
  Selector::getAsIdentifierInfo() (which could crash when IdentifierInfo* is
  null) and instead use Selector::getAsString().
- Tidy up Selector::getAsString() implementation.

llvm-svn: 66313
2009-03-07 01:22:02 +00:00
Ted Kremenek 5f080b43fa Handle null IdentifierInfo* in Selector::getAsString().
llvm-svn: 66307
2009-03-06 23:36:28 +00:00
Chris Lattner bd61a95481 Include information about compound statements when crashing in sema or the
parser.  For example, we now print out:

0.	t.c:5:10: in compound statement {}
1.	t.c:3:12: in compound statement {}
2.	clang t.c -fsyntax-only

llvm-svn: 66108
2009-03-05 00:00:31 +00:00
Chris Lattner 1a84994c46 allocate MultiKeywordSelector's out of a bump pointer allocator instead of malloc.
This has two advantages 1) no more leaking them, 2) fewer calls to malloc.

This changes us from calling malloc 3685/1390/883/2974/1185 times respectively on
16/20/24/28/32 byte objects when parsing cocoa.h with pth and -disable-free to
calling it 2816/1020/702/2903/1168 times each respectively.

llvm-svn: 66017
2009-03-04 05:35:38 +00:00
Chris Lattner 5c3529634a implement support for propagating *features* down to the code generator
and defining target-specific macros based on them (like __SSE3__ and 
friends).  After extensive discussion with Daniel, this work will need
driver support, which will translate things like -msse3 into a -mattr 
feature.  Until this work is done, the code in clang.cpp is disabled and
the X86TargetInfo ctor still defaults to SSE2.  With these two things
changed, this code will work.  PR3634

llvm-svn: 65966
2009-03-03 19:56:18 +00:00
Chris Lattner 96e43578fc Add plumbing to support programatically defining __SSE2__ and friends,
even though we still hard code sse2 for now.  No support for 3dnow or sse4a,
but someone could add that if they desired.

llvm-svn: 65886
2009-03-02 22:40:39 +00:00
Chris Lattner ecd49037ec minor cleanups to target-specific #defines, no functionality change.
llvm-svn: 65885
2009-03-02 22:27:17 +00:00
Chris Lattner c25d8a7e30 improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)
llvm-svn: 65884
2009-03-02 22:20:04 +00:00
Anders Carlsson 5843635b37 TargetInfo::validateAsmConstraint now takes a reference to the full constraints string. This will make it possible to support multi-character constraints. No functionality change (for now).
llvm-svn: 65696
2009-02-28 17:11:49 +00:00
Douglas Gregor 96977da72c Clean up and document code modification hints.
llvm-svn: 65641
2009-02-27 17:53:17 +00:00
Douglas Gregor 87f95b0a6a Introduce code modification hints into the diagnostics system. When we
know how to recover from an error, we can attach a hint to the
diagnostic that states how to modify the code, which can be one of:

  - Insert some new code (a text string) at a particular source
    location
  - Remove the code within a given range
  - Replace the code within a given range with some new code (a text
    string)

Right now, we use these hints to annotate diagnostic information. For
example, if one uses the '>>' in a template argument in C++98, as in
this code:

  template<int I> class B { };
  B<1000 >> 2> *b1;

we'll warn that the behavior will change in C++0x. The fix is to
insert parenthese, so we use code insertion annotations to illustrate
where the parentheses go:

test.cpp:10:10: warning: use of right-shift operator ('>>') in template
argument will require parentheses in C++0x
  B<1000 >> 2> *b1;
         ^
    (        )


Use of these annotations is partially implemented for HTML
diagnostics, but it's not (yet) producing valid HTML, which may be
related to PR2386, so it has been #if 0'd out.

In this future, we could consider hooking this mechanism up to the
rewriter to actually try to fix these problems during compilation (or,
after a compilation whose only errors have fixes). For now, however, I
suggest that we use these code modification hints whenever we can, so
that we get better diagnostics now and will have better coverage when
we find better ways to use this information.

This also fixes PR3410 by placing the complaint about missing tokens
just after the previous token (rather than at the location of the next
token).

llvm-svn: 65570
2009-02-26 21:00:50 +00:00
Fariborz Jahanian 30b3ac5e9e Minor refactoring.
llvm-svn: 65414
2009-02-24 23:38:42 +00:00
Fariborz Jahanian 240f2b7851 patch for two things.
make sure objc2's nonfragile abi is enacted for Leopard too.
add -fobjc-gc-only flag to the image_info symbol.

llvm-svn: 65413
2009-02-24 23:34:44 +00:00
Chris Lattner d0b80c8c75 add support for amd64-*, patch by Brooks Davis!
llvm-svn: 65124
2009-02-20 17:04:14 +00:00
Chris Lattner cf868c458c replace a dirty hack with a clean solution. Too bad we can't
use Blocks for our callbacks ;-)

llvm-svn: 65083
2009-02-19 23:53:20 +00:00
Chris Lattner 810d330cd3 Fix a long standard problem with clang retaining "too much" sugar
information about types.  We often print diagnostics where we say 
"foo_t" is bad, but the user doesn't know how foo_t is declared 
(because it is a typedef).  Fix this by expanding sugar when present
in a diagnostic (and not one of a few special cases, like vectors).

Before:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' and 'typeof(F)')
 MAX(P, F);
 ^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                             ^

After:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
 MAX(P, F);
 ^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                             ^

llvm-svn: 65081
2009-02-19 23:45:49 +00:00
Chris Lattner a6f037cee1 add an accessor.
llvm-svn: 64760
2009-02-17 08:39:06 +00:00
Chris Lattner 8ad52d5068 add an accessor.
llvm-svn: 64758
2009-02-17 08:04:48 +00:00
Chris Lattner 9ee10ea535 fix a minor bug with my previous patch
llvm-svn: 64747
2009-02-17 06:52:20 +00:00
Chris Lattner d2a2c13474 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.

llvm-svn: 64746
2009-02-17 06:49:55 +00:00
Douglas Gregor 9eebd9709a Supply the header corresponding to a library builtin as a separate argument to the LIBBUILTIN macro
llvm-svn: 64676
2009-02-16 21:58:21 +00:00
Chris Lattner f52c0b261c add a new SourceManager::getInstantiationRange helper method.
llvm-svn: 64606
2009-02-15 21:26:50 +00:00
Chris Lattner 9dc9c206d3 track "just a little more" location information for macro instantiations.
Now instead of just tracking the expansion history, also track the full
range of the macro that got replaced.  For object-like macros, this doesn't
change anything.  For _Pragma and function-like macros, this means we track
the locations of the ')'.

This is required for PR3579 because apparently GCC uses the line of the ')'
of a function-like macro as the location to expand __LINE__ to.

llvm-svn: 64601
2009-02-15 20:52:18 +00:00
Douglas Gregor 69c7951c8e Add -ffreestanding to suppress the implicit declaration of library builtins like printf and malloc. Fixes PR3586
llvm-svn: 64566
2009-02-14 20:49:29 +00:00
Anton Korobeynikov 7e96595f11 Define __ELF__ on FreeBSD. Patch by Roman Divacky!
llvm-svn: 64557
2009-02-14 16:42:50 +00:00
Cedric Venet d3c80de95f Fix the build on win32.
llvm-svn: 64556
2009-02-14 16:15:20 +00:00
Argyrios Kyrtzidis d831cac2a7 Define __ELF__ for linux systems.
llvm-svn: 64553
2009-02-14 15:02:45 +00:00
Chris Lattner 7e4c81c8c6 Give TargetInfo a new IntPtrType to hold the intptr_t type for
a target.

Make Preprocessor.cpp define a new __INTPTR_TYPE__ macro based on this.

On linux/32, set intptr_t to int, instead of long.  This fixes PR3563.

llvm-svn: 64495
2009-02-13 22:28:55 +00:00
Fariborz Jahanian 13de253bd6 Make nonfragile-abi the default for darwin's 64bit
abi for objective-c programs.

llvm-svn: 64386
2009-02-12 17:54:33 +00:00
Ted Kremenek 5d7e2e1781 FileManager:
- set the 'StatSysCallCache' object using a setter method instead of
  FileManager's constructor. This allows the cache to be installed after the
  FileManager object is created.
- Add 'file mode' to FileEntry (useful for stat caching)

llvm-svn: 64351
2009-02-12 03:17:57 +00:00
Chris Lattner 882018b890 search and replaceo?
llvm-svn: 64348
2009-02-12 01:37:35 +00:00
Ted Kremenek c8b740eade Add lightweight shim "clang::StatSysCallCache" that caches 'stat' system calls
for use by FileManager. FileManager now takes a StatSysCallCache* in its
constructor (which defaults to NULL). This will be used for evaluating whether
or not caching 'stat' system calls in PTH is a performance win. This shim adds
no observable performance impact in the case where the 'StatSysCallCache*' is
null.

llvm-svn: 64345
2009-02-12 00:39:05 +00:00
Chris Lattner a91c30fdb0 simplify and refactor a bunch of type definition code in Preprocessor
predefines buffer initialization.

llvm-svn: 63919
2009-02-06 05:04:11 +00:00
Chris Lattner 9e03119446 don't emit any diagnostics after a fatal one.
llvm-svn: 63914
2009-02-06 04:16:02 +00:00
Chris Lattner fbe2272fc8 add support to the diagnostics machinery for mapping warnings and
errors to 'fatal' error severity.

llvm-svn: 63894
2009-02-05 22:47:05 +00:00
Chris Lattner d0a79b2eb8 make clang agree with gcc 4.2's x86-64 predefines and settings.
llvm-svn: 63849
2009-02-05 07:32:46 +00:00
Chris Lattner 8181312251 fix some differences between apple gcc and clang on darwin/x86-32.
llvm-svn: 63846
2009-02-05 07:19:24 +00:00
Douglas Gregor 2ada048975 Some name-lookup-related fixes, from Piotr Rak!
- Changes Lookup*Name functions to return NamedDecls, instead of
Decls. Unfortunately my recent statement that it will simplify lot of
code, was not quite right, but it simplifies some...
- Makes MergeLookupResult SmallPtrSet instead of vector, following
Douglas suggestions.
- Adds %qN format for printing qualified names to Diagnostic.
- Avoids searching for using-directives in Scopes, which are not
DeclScope, during unqualified name lookup.

llvm-svn: 63739
2009-02-04 17:27:36 +00:00
Chris Lattner 1c967784f3 Implement handling of file entry/exit notifications from GNU
line markers, including maintenance of the virtual include stack.

For something like this:

# 42 "bar.c" 1
# 142 "bar2.c" 1

#warning zappa
# 92 "bar.c" 2
#warning gonzo
# 102 "foo.c" 2
#warning bonkta


we now produce these three warnings:

#1:
In file included from foo.c:3:
In file included from bar.c:42:
bar2.c:143:2: warning: #warning zappa
#warning zappa
 ^

#2:
In file included from foo.c:3:
bar.c:92:2: warning: #warning gonzo
#warning gonzo
 ^

#3:
foo.c:102:2: warning: #warning bonkta
#warning bonkta
 ^

llvm-svn: 63722
2009-02-04 06:25:26 +00:00
Chris Lattner 95d9c5e778 make getFileCharacteristic linetable aware. line markers that
play around with the 'is system header' bit now function correctly.

llvm-svn: 63720
2009-02-04 05:33:01 +00:00
Chris Lattner 0a1a8d8514 propagate linemarker flags down into the the line table, currently
ignoring include stack push/pop info though.

llvm-svn: 63719
2009-02-04 05:21:58 +00:00
Chris Lattner 334a2ada06 replace gimpy linear search with svelte binary search ;-)
llvm-svn: 63717
2009-02-04 04:46:59 +00:00
Chris Lattner 8411e168f8 make my atrocious linear search at least search in the order that is
more likely to hit.

llvm-svn: 63714
2009-02-04 02:29:52 +00:00
Chris Lattner 20c50ba26c add comment
llvm-svn: 63712
2009-02-04 02:15:40 +00:00
Chris Lattner c1219ff7cc add the difference in the line marker phys line number and the
query point to the returned presumed location.  We now produce:

foo.h:92:2: warning: #warning blarg!
#warning blarg!
 ^
foo.h:93:2: warning: #warning blarg!
#warning blarg!
 ^
foo.h:94:2: warning: #warning blarg!
#warning blarg!
 ^

for:

#line 92 "foo.h"
#warning blarg!
#warning blarg!
#warning blarg!

blarg indeed!

llvm-svn: 63710
2009-02-04 02:00:59 +00:00
Chris Lattner d429392285 add really really trivial #line support, where #line now makes every
location below it report as coming from the #line location.  For example,
with:

#line 92 "foo.h"
#warning blarg!
#warning blarg!

we now emit:

foo.h:92:2: warning: #warning blarg!
#warning blarg!
 ^
foo.h:92:2: warning: #warning blarg!
#warning blarg!
 ^

llvm-svn: 63709
2009-02-04 01:55:42 +00:00
Chris Lattner 88ea93e6b4 lower the interface to getLineNumber like we did for
getColumnNumber.  This fixes a FIXME in 
SourceManager::getPresumedLoc because we now just decompose
the sloc once.

llvm-svn: 63701
2009-02-04 01:06:56 +00:00
Chris Lattner e4ad417664 make SM::getColumnNumber take a predecomposed FileID/offset, which
makes it clear to clients that they have to pick an instantiation
or spelling location before calling it and allows optimization based
on that.

llvm-svn: 63698
2009-02-04 00:55:58 +00:00
Chris Lattner 153a0f1f52 build per-fid linetable entries.
llvm-svn: 63694
2009-02-04 00:40:31 +00:00
Chris Lattner 6e0e1f49a5 more plumbing for #line propagation. Use happy bit #3
out of FileInfo :)

llvm-svn: 63672
2009-02-03 22:13:05 +00:00
Chris Lattner 1eaa70a612 stub out basic #line handling calls.
llvm-svn: 63667
2009-02-03 21:52:55 +00:00
Chris Lattner 9be4f6d6c7 reclaim my precious bit in FileInfo by ensuring that ContentCache objects
are 8-byte aligned.

llvm-svn: 63630
2009-02-03 07:41:46 +00:00
Chris Lattner c8233df64b switch SourceManager from using an std::map and std::list of
ContentCache objects to using a densemap and list, and allocating
the ContentCache objects from a bump pointer.  This does not speed
up or slow down things substantially, but gives us control over 
their alignment.

llvm-svn: 63628
2009-02-03 07:30:45 +00:00
Chris Lattner 4b6713ef20 next round of diagnostics cleanups, moving some
diags around, eliminating #defines, etc.  Patch by
Anders Johnsen!

llvm-svn: 63318
2009-01-29 17:46:13 +00:00
Chris Lattner 36790cf29a Fix -Wimplicit-function-declaration, which required some refactoring and
changes in various diagnostics code.

llvm-svn: 63282
2009-01-29 06:55:46 +00:00
Ted Kremenek bf16554640 Add method FullSourceLoc::getBufferData().
llvm-svn: 63229
2009-01-28 20:46:26 +00:00
Chris Lattner 22ebe7ba66 long long and double have 64-bit alignment on x86-64.
llvm-svn: 63191
2009-01-28 06:58:19 +00:00
Ted Kremenek 1502b7e288 On Windows use a BumpPtrAllocator for the UniqueFileContainer's StringMap.
llvm-svn: 63162
2009-01-28 01:01:07 +00:00
Ted Kremenek bb2f25b40f FileManager: Use a BumpPtrAllocator for the StringMaps DirEntries and FileEntries.
Performance impact (clang -fsyntax-only INPUTS/Cocoa_h.m):
  non-PTH: 0.4% improvement
  PTH: 0.8% improvement

llvm-svn: 63159
2009-01-28 00:44:12 +00:00
Ted Kremenek 5c04bd81ed Add a some comments to designate Windows-specific/Unix-specific code. No functionality change.
llvm-svn: 63157
2009-01-28 00:27:31 +00:00
Anders Carlsson 570c357ded If an input constraint refers to an output constraint, it should have the same constraint info as the output constraint. Fixes PR3417
llvm-svn: 63127
2009-01-27 20:38:24 +00:00
Chris Lattner 7368d581c1 Split the single monolithic DiagnosticKinds.def file into one
.def file for each library.  This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.

Patch by Anders Johnsen!

llvm-svn: 63111
2009-01-27 18:30:58 +00:00
Chris Lattner f1ca7d3e02 Introduce a new PresumedLoc class to represent the concept of a location
as reported to the user and as manipulated by #line.  This is what __FILE__,
__INCLUDE_LEVEL__, diagnostics and other things should follow (but not 
dependency generation!).  

This patch also includes several cleanups along the way: 

- SourceLocation now has a dump method, and several other places 
  that did similar things now use it.
- I cleaned up some code in AnalysisConsumer, but it should probably be
  simplified further now that NamedDecl is better.
- TextDiagnosticPrinter is now simplified and cleaned up a bit.

This patch is a prerequisite for #line, but does not actually provide 
any #line functionality.

llvm-svn: 63098
2009-01-27 07:57:44 +00:00
Chris Lattner 6d61c3e6df make -print-stats print stats about the amount of the SLoc
address space we used up.  Some interesting data:

For c99-intconst-1.c:
6912762 SLocEntry's allocated, 25592386B of Sloc address space used.

For cocoa.h:
26469 SLocEntry's allocated, 10278752B of Sloc address space used.

For carbon.h:
27364 SLocEntry's allocated, 12398141B of Sloc address space used.

Clearly 2G of sloc address space should be enough for anyone?!

llvm-svn: 63093
2009-01-27 05:22:43 +00:00
Chris Lattner 9b415d6142 add SparcV8 asm register info support. Patch by Ben Lickly!
llvm-svn: 63085
2009-01-27 01:58:38 +00:00
Chris Lattner 2d86c700bf now that everything properly handles multiply instantiated
source locations, allow creation of them.  We can now say that
a token was instantiated here, then here, then here.

llvm-svn: 63034
2009-01-26 20:08:26 +00:00
Chris Lattner 659ac5f087 make getInstantiationLoc and getSpellingLoc handle multiply instantiated
locations, and move the slow case out of line.  No perf change on cocoa.h

llvm-svn: 63033
2009-01-26 20:04:19 +00:00
Chris Lattner 31af4e08d1 fix a negated conditional in getDecomposedInstantiationLocSlowCase,
which I think is rdar://6527005, and make getDecomposedSpellingLocSlowCase
handle nested spelling locations.

llvm-svn: 63030
2009-01-26 19:41:58 +00:00
Chris Lattner b5fba6f8d8 start plumbing together the line table information. So far we just
unique the Filenames in #line directives, assigning them UIDs.

llvm-svn: 63010
2009-01-26 07:57:50 +00:00
Chris Lattner 43a85b1e4c Lazily paging in file contents is a big win for PTH, strip out the old
testing code.

llvm-svn: 63006
2009-01-26 07:37:49 +00:00
Chris Lattner 4fa23625ab Check in the long promised SourceLocation rewrite. This lays the
ground work for implementing #line, and fixes the "out of macro ID's" 
problem.

There is nothing particularly tricky about the code, other than the
very performance sensitive SourceManager::getFileID() method.

llvm-svn: 62978
2009-01-26 00:43:02 +00:00
Anders Carlsson a0b892113a Handle the 'e' constraint. Fixes PR3385
llvm-svn: 62923
2009-01-24 18:03:09 +00:00
Ted Kremenek ea06ec1cad Added virtual method DiagnosticClient::IncludeInDiagnosticCounts(). This is used by Diagnostics to determine if a diagnostic sent to a given DiagnosticClient should be included in the count of diagnostics. The default implementation of this method returns 'true'.
Implemented DiagCollector::IncludeInDiagnosticCounts() to return 'false' so that the batching of diagnostics for use with BugReporter doesn't mess up the count of real diagnostics.

llvm-svn: 62873
2009-01-23 20:28:53 +00:00
Chris Lattner ad89ec013f Add a bit to IdentifierInfo that acts as a simple predicate which
tells us whether Preprocessor::HandleIdentifier needs to be called.
Because this method is only rarely needed, this saves a call and a
bunch of random checks.  This drops the time in HandleIdentifier 
from 3.52ms to .98ms on cocoa.h on my machine.

llvm-svn: 62675
2009-01-21 07:43:11 +00:00
Ted Kremenek 52f73cad4a Fix: <rdar://problem/6510344> [pth] PTH slows down regular lexer considerably (when it has substantial work)
Changes to IdentifierTable:
- High-level summary: StringMap never owns IdentifierInfos.  It just
references them.
- The string map now has StringMapEntry<IdentifierInfo*> instead of
  StringMapEntry<IdentifierInfo>.  The IdentifierInfo object is
  allocated using the same bump pointer allocator as used by the
  StringMap.

Changes to IdentifierInfo:
- Added an extra pointer to point to the
  StringMapEntry<IdentifierInfo*> in the string map.  This pointer
  will be null if the IdentifierInfo* is *only* used by the PTHLexer
  (that is it isn't in the StringMap).

Algorithmic changes:
- Non-PTH case:
   IdentifierInfo::get() will always consult the StringMap first to
   see if we have an IdentifierInfo object.  If that StringMapEntry
   references a null pointer, we allocate a new one from the BumpPtrAllocator
   and update the reference in the StringMapEntry.
- PTH case:
   We do the same lookup as with the non-PTH case, but if we don't get
   a hit in the StringMap we do a secondary lookup in the PTHManager for
   the IdentifierInfo.  If we don't find an IdentifierInfo we create a
   new one as in the non-PTH case.  If we do find and IdentifierInfo
   in the PTHManager, we update the StringMapEntry to refer to it so
   that the IdentifierInfo will be found on the next StringMap lookup.
   This way we only do a binary search in the PTH file at most once
   for a given IdentifierInfo.  This greatly speeds things up for source
   files containing a non-trivial amount of code.

Performance impact:
   While these changes do add some extra indirection in
   IdentifierTable to access an IdentifierInfo*, I saw speedups even
   in the non-PTH case as well.

   Non-PTH: For -fsyntax-only on Cocoa.h, we see a 6% speedup.
   PTH (with Cocoa.h in token cache): 11% speedup.

   I also did an experiment where we did -fsyntax-only on a source file
   including a large header and Cocoa.h, but the token cache did not
   contain the larger header.  For this file, we were seeing a performance
   *regression* when using PTH of 3% over non-PTH.  Now we are seeing
   a performance improvement of 9%!

Tests:
   The serialization tests are now failing.  I looked at this extensively,
   and I my belief is that this change is unmasking a bug rather than
   introducing a new one.  I have disabled the serialization tests for now.

llvm-svn: 62636
2009-01-20 23:28:34 +00:00
Chris Lattner cbc35ecb04 Rename SourceManager::getCanonicalFileID -> getFileID. There is
no longer such thing as a non-canonical FileID.

llvm-svn: 62499
2009-01-19 07:46:45 +00:00
Chris Lattner 1e9e86f470 remove the public SourceManager::getContentCacheForLoc method.
llvm-svn: 62497
2009-01-19 07:40:40 +00:00
Chris Lattner f809bbdbb8 remove the SourceManager:: and FullSourceLoc::getFileEntryForLoc methods.
llvm-svn: 62496
2009-01-19 07:36:42 +00:00
Chris Lattner 7e343b2161 SourceManager::getBufferData(SourceLocation) is dead, delete it.
llvm-svn: 62495
2009-01-19 07:32:13 +00:00
Chris Lattner 91fda39454 some minor cleanups to SourceManager, and eliminate the
SourceManager::getBuffer(SourceLocation) method.

llvm-svn: 62494
2009-01-19 07:30:29 +00:00
Anders Carlsson e70cde134e Handle the 'X' constraint. Fixes <rdar://problem/6504897>.
llvm-svn: 62446
2009-01-18 02:12:04 +00:00
Anders Carlsson a79203be85 Add sema support for symbolic names in inline asm statements.
llvm-svn: 62441
2009-01-18 01:56:57 +00:00
Nate Begeman 95439108e8 Fit in 80 cols
llvm-svn: 62439
2009-01-18 01:08:03 +00:00
Nate Begeman a45707c06a Allow targets to override IntMaxTWidth
llvm-svn: 62434
2009-01-17 23:56:13 +00:00
Anders Carlsson 19aa04d270 Change TargetInfo::validateInputConstraint to take begin/end name iterators instead of the number of outputs. No functionality change.
llvm-svn: 62433
2009-01-17 23:36:15 +00:00
Chris Lattner 71dc14b9f0 Rename SourceLocation::getFileID to getChunkID, because it returns
the chunk ID not the file ID.  This exposes problems in 
TextDiagnosticPrinter where it should have been using the canonical
file ID but wasn't.  Fix these along the way.

llvm-svn: 62427
2009-01-17 08:45:21 +00:00
Chris Lattner d32480d3db this massive patch introduces a simple new abstraction: it makes
"FileID" a concept that is now enforced by the compiler's type checker
instead of yet-another-random-unsigned floating around.

This is an important distinction from the "FileID" currently tracked by
SourceLocation.  *That* FileID may refer to the start of a file or to a
chunk within it.  The new FileID *only* refers to the file (and its 
#include stack and eventually #line data), it cannot refer to a chunk.

FileID is a completely opaque datatype to all clients, only SourceManager
is allowed to poke and prod it.

llvm-svn: 62407
2009-01-17 06:22:33 +00:00
Chris Lattner 800979259e make "ContentCache::Buffer" mutable to avoid a const_cast.
llvm-svn: 62403
2009-01-17 03:54:16 +00:00
Chris Lattner fb1fd911cb Make FullSourceLoc derive from SourceLocation instead of
containing one.  Containment is generally better than derivation,
but in this case FullSourceLoc really 'isa' SourceLocation.

llvm-svn: 62375
2009-01-16 23:03:56 +00:00
Chris Lattner fcc0a5a3f7 elimiante FullSourceLoc::getCanonicalFileID
llvm-svn: 62374
2009-01-16 22:59:51 +00:00
Chris Lattner 7067b4f49d remove FullSourceLoc::isFileID
llvm-svn: 62371
2009-01-16 22:53:56 +00:00
Chris Lattner 8a42586c54 more SourceLocation lexicon change: instead of referring to the
"logical" location, refer to the "instantiation" location.

llvm-svn: 62316
2009-01-16 07:36:28 +00:00
Chris Lattner 3c91971b33 rename "virtual location" of a macro to "instantiation location".
llvm-svn: 62315
2009-01-16 07:15:35 +00:00
Chris Lattner 53e384f633 Change some terminology in SourceLocation: instead of referring to
the "physical" location of tokens, refer to the "spelling" location.
This is more concrete and useful, tokens aren't really physical objects!

llvm-svn: 62309
2009-01-16 07:00:02 +00:00
Ted Kremenek a705b04d7f IdentifierInfo:
- IdentifierInfo can now (optionally) have its string data not be
  co-located with itself.  This is for use with PTH.  This aspect is a
  little gross, as getName() and getLength() now make assumptions
  about a possible alternate representation of IdentifierInfo.
  Perhaps we should make IdentifierInfo have virtual methods?

IdentifierTable:
- Added class "IdentifierInfoLookup" that can be used by
  IdentifierTable to perform "string -> IdentifierInfo" lookups using
  an auxilliary data structure.  This is used by PTH.
- Perform tests show that IdentifierTable::get() does not slow down
  because of the extra check for the IdentiferInfoLookup object (the
  regular StringMap lookup does enough work to mitigate the impact of
  an extra null pointer check).
- The upshot is that now that some IdentifierInfo objects might be
  owned by the IdentiferInfoLookup object.  This should be reviewed.

PTH:
- Modified PTHManager::GetIdentifierInfo to *not* insert entries in
  IdentifierTable's string map, and instead create IdentifierInfo
  objects on the fly when mapping from persistent IDs to
  IdentifierInfos.  This saves a ton of work with string copies,
  hashing, and StringMap lookup and resizing.  This change was
  motivated because when processing source files in the PTH cache we
  don't need to do any string -> IdentifierInfo lookups.
- PTHManager now subclasses IdentifierInfoLookup, allowing clients of
  IdentifierTable to transparently use IdentifierInfo objects managed
  by the PTH file.  PTHManager resolves "string -> IdentifierInfo"
  queries by doing a binary search over a sorted table of identifier
  strings in the PTH file (the exact algorithm we use can be changed
  as needed).

These changes lead to the following performance changes when using PTH on Cocoa.h:
- fsyntax-only: 10% performance improvement
- Eonly: 30% performance improvement

llvm-svn: 62273
2009-01-15 18:47:46 +00:00
Anders Carlsson 30c235d182 Make sure to initialize the ConstraintInfo to 0
llvm-svn: 62068
2009-01-12 02:15:29 +00:00
Ted Kremenek 763ea559ac SourceManager: Implement "lazy" creation of MemBuffers for source files.
- Big Idea:
   Source files are now mmaped when ContentCache::getBuffer() is first called.
   While this doesn't change the functionality when lexing regular source files,
   it can result in source files not being paged in when using PTH.

- Performance change:
  - No observable difference (-fsyntax-only/-Eonly) on Cocoa.h when doing
    regular source lexing.
  - No observable time difference (-fsyntax-only/-Eonly) on Cocoa.h when using
    PTH. We do observe, however, a reduction of 279K in memory mapped source
    code (3% reduction). The majority of pages from Cocoa.h (and friends) are
    still being pulled in, however, because any literal will cause
    Preprocessor::getSpelling() to be called (causing the source for the file to
    get pulled in). The next possible optimization is to cache literal strings
    in the PTH file to avoid the need for the original header sources entirely.

- Right now there is a preprocessor directive to toggle between "lazy" and
  "eager" creation of MemBuffers. This is not permanent, and is there in the
  short term to just test additional optimizations.

llvm-svn: 61827
2009-01-06 22:43:04 +00:00
Ted Kremenek 12c2af44e9 Misc changes to SourceManager::ContentCache:
- 'Buffer' is now private and must be accessed via 'getBuffer()'.
   This paves the way for lazily mapping in source files on demand.
- Added 'getSize()' (which gets the size of the content without
   necessarily accessing the MemBuffer) and 'getSizeBytesMapped()'.
- Modifed SourceManager to use these new methods.  This reduces the
  number of places that actually access the MemBuffer object for a file
  to those that actually look at the character data.

These changes result in no performance change for -fsyntax-only on Cocoa.h.

llvm-svn: 61782
2009-01-06 01:55:26 +00:00
Chris Lattner 2ca529ce61 instead of forcing blocks on by default, make them default to off, but let
specific targets default them to on.  Default blocks to on on 10.6 and later.
Add a -fblocks option that allows the user to override the target's default.
Use -fblocks in the various testcases that use blocks.

llvm-svn: 60563
2008-12-04 23:20:07 +00:00
Chris Lattner c7c6dd4d97 replace useNeXTRuntimeAsDefault with a generic hook that allows targets
to specify their default language options.

llvm-svn: 60561
2008-12-04 22:54:33 +00:00
Sebastian Redl 3ceaf62240 Fix order of evaluation.
llvm-svn: 60160
2008-11-27 07:28:14 +00:00
Chris Lattner e4b95698df Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method.

Change uses of Selector::getName() to just pass in a Selector 
where possible (e.g. to diagnostics) instead of going through
an std::string.

This also adds new formatters for objcinstance and objcclass
as described in the dox.

llvm-svn: 59933
2008-11-24 03:33:13 +00:00
Chris Lattner e3d20d9545 Convert IdentifierInfo's to be printed the same as DeclarationNames
with implicit quotes around them.  This has a bunch of follow-on 
effects and requires tweaking to a whole lot of code.  This causes
a regression in two tests (xfailed) by causing it to emit things like:

  Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')

instead of:

  Line 10: duplicate interface declaration for category 'MyClass1(Category1)'

I will fix this in a follow-up commit.

As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency.  This is good, but I was planning to do this
as an independent patch.  There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.

llvm-svn: 59917
2008-11-23 21:45:46 +00:00
Chris Lattner f7e69d5a77 add support for inserting a DeclarationName into a diagnostic directly
without calling getAsString().  This implicitly puts quotes around the
name, so diagnostics need to be tweaked to accommodate this.

llvm-svn: 59916
2008-11-23 20:28:15 +00:00
Chris Lattner 63ecc509e3 Genericize the qualtype formating callback to support any diag argument.
No functionality change.

llvm-svn: 59908
2008-11-23 09:21:17 +00:00
Chris Lattner 6a2ed6f6dc Add support for sending QualType's directly into diags and convert two
diags over to use this.  QualTypes implicitly print single quotes around 
them for uniformity and future extension.

Doing this requires a little function pointer dance to prevent libbasic
from depending on libast.

llvm-svn: 59907
2008-11-23 09:13:29 +00:00
Sebastian Redl 15b02d2e62 Implement a %plural modifier for complex plural forms in diagnostics. Use it in the overload diagnostics.
llvm-svn: 59871
2008-11-22 13:44:36 +00:00
Chris Lattner 427c9c1763 Split the DiagnosticInfo class into two disjoint classes:
one for building up the diagnostic that is in flight (DiagnosticBuilder)
and one for pulling structured information out of the diagnostic when
formatting and presenting it.

There is no functionality change with this patch.

llvm-svn: 59849
2008-11-22 00:59:29 +00:00
Chris Lattner 2b78690a9c Add the concept of "modifiers" to the clang diagnostic format
strings.  This allows us to have considerable flexibility in how
these things are displayed and provides extra information that
allows us to merge away diagnostics that are very similar.

Diagnostic modifiers are a string of characters with the regex
[-a-z]+ that occur between the % and digit.  They may 
optionally have an argument that can parameterize them.

For now, I've added two example modifiers.  One is a very useful
tool that allows you to factor commonality across diagnostics
that need single words or phrases combined.  Basically you can
use %select{a|b|c}4 with with an integer argument that selects
either a/b/c based on an integer value in the range [0..3).

The second modifier is also an integer modifier, aimed to help
English diagnostics handle plurality.  "%s3" prints to 's' if 
integer argument #3 is not 1, otherwise it prints to nothing.
I'm fully aware that 's' is an English concept and doesn't
apply to all situations (mouse vs mice).  However, this is very
useful and we can add other crazy modifiers once we add support
for polish! ;-)

I converted a couple C++ diagnostics over to use this as an
example, I'd appreciate it if others could merge the other
likely candiates.  If you have other modifiers that you want,
lets talk on cfe-dev.

llvm-svn: 59803
2008-11-21 07:50:02 +00:00
Chris Lattner b91fd17b7d Allow sending IdentifierInfo*'s into Diagnostics without turning them into strings
first.  This should allow removal of a bunch of II->getName() calls.

llvm-svn: 59601
2008-11-19 07:32:16 +00:00
Chris Lattner 91aea716c6 add direct support for signed and unsigned integer arguments to diagnostics.
llvm-svn: 59598
2008-11-19 07:22:31 +00:00
Chris Lattner 23be067407 rewrite FormatDiagnostic to be less gross and a lot more efficient.
This also makes it illegal to have bare '%'s in diagnostics.  If you
want a % in a diagnostic, use %%.

llvm-svn: 59596
2008-11-19 06:51:40 +00:00
Chris Lattner 8d5bec4c7d implement a transparent optimization with the diagnostics stuff:
const char*'s are now not converted to std::strings when the diagnostic
is formed, we just hold onto their pointer and format as needed.

This commit makes DiagnosticClient::FormatDiagnostic even more of a 
mess, I'll fix it in the next commit.

llvm-svn: 59593
2008-11-19 06:04:55 +00:00
Douglas Gregor 163c58502a Extend DeclarationName to support C++ overloaded operators, e.g.,
operator+, directly, using the same mechanism as all other special
names.

Removed the "special" identifiers for the overloaded operators from
the identifier table and IdentifierInfo data structure. IdentifierInfo
is back to representing only real identifiers.

Added a new Action, ActOnOperatorFunctionIdExpr, that builds an
expression from an parsed operator-function-id (e.g., "operator
+"). ActOnIdentifierExpr used to do this job, but
operator-function-ids are no longer represented by IdentifierInfo's.

Extended Declarator to store overloaded operator names. 
Sema::GetNameForDeclarator now knows how to turn the operator
name into a DeclarationName for the overloaded operator. 

Except for (perhaps) consolidating the functionality of
ActOnIdentifier, ActOnOperatorFunctionIdExpr, and
ActOnConversionFunctionExpr into a common routine that builds an
appropriate DeclRefExpr by looking up a DeclarationName, all of the
work on normalizing declaration names should be complete with this
commit.

llvm-svn: 59526
2008-11-18 14:39:36 +00:00
Chris Lattner 8488c8297c This reworks some of the Diagnostic interfaces a bit to change how diagnostics
are formed.  In particular, a diagnostic with all its strings and ranges is now
packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a 
ton of random stuff.  This has the benefit of simplifying the interface, making
it more extensible, and allowing us to do more checking for things like access
past the end of the various arrays passed in.

In addition to introducing DiagnosticInfo, this also substantially changes how 
Diagnostic::Report works.  Instead of being passed in all of the info required
to issue a diagnostic, Report now takes only the required info (a location and 
ID) and returns a fresh DiagnosticInfo *by value*.  The caller is then free to
stuff strings and ranges into the DiagnosticInfo with the << operator.  When
the dtor runs on the DiagnosticInfo object (which should happen at the end of
the statement), the diagnostic is actually emitted with all of the accumulated
information.  This is a somewhat tricky dance, but it means that the 
accumulated DiagnosticInfo is allowed to keep pointers to other expression 
temporaries without those pointers getting invalidated.

This is just the minimal change to get this stuff working, but this will allow
us to eliminate the zillions of variant "Diag" methods scattered throughout
(e.g.) sema.  For example, instead of calling:

  Diag(BuiltinLoc, diag::err_overload_no_match, typeNames,
       SourceRange(BuiltinLoc, RParenLoc));

We will soon be able to just do:

  Diag(BuiltinLoc, diag::err_overload_no_match)
      << typeNames << SourceRange(BuiltinLoc, RParenLoc));

This scales better to support arbitrary types being passed in (not just 
strings) in a type-safe way.  Go operator overloading?!

llvm-svn: 59502
2008-11-18 07:04:44 +00:00
Chris Lattner 746d474b28 SourceManager::getLineNumber is logically const except for caching.
Use mutable to make it so.

llvm-svn: 59498
2008-11-18 06:51:15 +00:00
Chris Lattner 16ba91396a Change the diagnostics interface to take an array of pointers to
strings instead of array of strings.  This reduces string copying
in some not-very-important cases, but paves the way for future 
improvements.

llvm-svn: 59494
2008-11-18 04:56:44 +00:00
Douglas Gregor 92751d41a0 Eliminate all of the placeholder identifiers used for constructors,
destructors, and conversion functions. The placeholders were used to
work around the fact that the parser and some of Sema really wanted
declarators to have simple identifiers; now, the code that deals with
declarators will use DeclarationNames.

llvm-svn: 59469
2008-11-17 22:58:34 +00:00
Douglas Gregor 77324f3854 Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.

llvm-svn: 59441
2008-11-17 14:58:09 +00:00
Chris Lattner e6de6252c2 Fix PR3077: tokens that come from macro expansions whose macro was
defined in a system header should be treated as system header tokens
even if they are instantiated in a different place.

llvm-svn: 59418
2008-11-16 18:36:34 +00:00
Douglas Gregor 993603d80d Add a new expression node, CXXOperatorCallExpr, which expresses a
function call created in response to the use of operator syntax that
resolves to an overloaded operator in C++, e.g., "str1 +
str2" that resolves to std::operator+(str1, str2)". We now build a
CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But
only for binary operators, where we actually implement overloading)

I decided *not* to refactor the current CallExpr to make it abstract
(with FunctionCallExpr and CXXOperatorCallExpr as derived
classes). Doing so would allow us to make CXXOperatorCallExpr a little
bit smaller, at the cost of making the argument and callee accessors
virtual. We won't know if this is going to be a win until we can parse
lots of C++ code to determine how much memory we'll save by making
this change vs. the performance penalty due to the extra virtual
calls.

llvm-svn: 59306
2008-11-14 16:09:21 +00:00
Douglas Gregor b6acda0f36 Don't build identifiers for C++ constructors, destructors, or
conversion functions. Instead, we just use a placeholder identifier
for these (e.g., "<constructor>") and override NamedDecl::getName() to
provide a human-readable name.

This is one potential solution to the problem; another solution would
be to replace the use of IdentifierInfo* in NamedDecl with a different
class that deals with identifiers better. I'm also prototyping that to
see how it compares, but this commit is better than what we had
previously.

llvm-svn: 59193
2008-11-12 23:21:09 +00:00
Douglas Gregor 6cf0806e75 Some cleanups to the declaration/checking of overloaded operators in C++. Thanks to Sebastian for the review
llvm-svn: 58986
2008-11-10 13:38:07 +00:00
Douglas Gregor 11d0c4c098 Parsing, ASTs, and semantic analysis for the declaration of overloaded
operators in C++. Overloaded operators can be called directly via
their operator-function-ids, e.g., "operator+(foo, bar)", but we don't
yet implement the semantics of operator overloading to handle, e.g.,
"foo + bar".

llvm-svn: 58817
2008-11-06 22:13:31 +00:00
Douglas Gregor 2ad7ee9145 Reclaim some bits in IdentifierInfo, for later use as overloaded operator names.
llvm-svn: 58806
2008-11-06 16:32:23 +00:00
Eli Friedman d50881c6a9 More fallout from r58501: primary fix is some more corrections to make
the types for size_t and ptrdiff_t more accurate.  I think all of these
are correct, but please compare the defines for __PTRDIFF_TYPE__ and 
__SIZE_TYPE__ to gcc to double-check; this particularly applies to 
those on BSD variants, since I'm not sure what they do here; I assume 
here that they're the same as on Linux.

Fixes wchar_t to be "int", not "unsigned int" (which I think is 
correct on everything but Windows).

Fixes ptrdiff_t to be "int" rather than "short" on PIC16; "short" is an 
somewhat strange choice because it normally gets promoted, and it's not 
consistent with the choice for size_t.

llvm-svn: 58556
2008-11-02 02:43:55 +00:00
Anders Carlsson 2a79a90430 Fix a bug that was introduced in 58501. Ideally I think we should force all targets to set these values and not have defaults.
llvm-svn: 58511
2008-10-31 16:05:19 +00:00
Sanjiv Gupta d79592448b Made the mechanism of defining preprocessor defs for maxint, ptrdiff_t, wchar
etc more generic. For some targets, long may not be equal to pointer size. For
example: PIC16 has int as i16, ptr as i16 but long as i32.

Also fixed a few build warnings in assert() functions in CFRefCount.cpp,
CGDecl.cpp, SemaDeclCXX.cpp and ParseDeclCXX.cpp.

llvm-svn: 58501
2008-10-31 09:52:39 +00:00
Chris Lattner 66a740e66e Rename Characteristic_t to CharacteristicKind
llvm-svn: 58224
2008-10-27 01:19:25 +00:00
Chris Lattner 69f9bc24f4 Fix the definition of __builtin_va_list on PPC, which was set to the V4 ABI, not the
darwin or AIX abis.  This fixes PR2904.

llvm-svn: 58222
2008-10-27 01:11:29 +00:00
Oscar Fuentes 07d9f9a6ec CMake: Builds and installs clang binary and libs (no docs yet). It
must be under the `tools' subdirectory of the LLVM *source* tree.

llvm-svn: 58180
2008-10-26 00:56:18 +00:00
Chris Lattner f0a5f84c42 fix rdar://6288301: custom warnings don't respect -Werror.
llvm-svn: 57731
2008-10-17 21:24:47 +00:00
Chris Lattner 3c3e2cc77f Add basic FreeBSD target support, patch by Roman Divacky!
llvm-svn: 57645
2008-10-16 17:04:31 +00:00
Anders Carlsson 5f7ee680f8 Add 'x' constraint character.
llvm-svn: 57198
2008-10-06 19:17:39 +00:00
Anders Carlsson 83661acf30 Add the 'y' assembler constraint.
llvm-svn: 57144
2008-10-06 00:41:45 +00:00
Chris Lattner 09d98f5d8a miscellaneous cleanups
llvm-svn: 57140
2008-10-05 21:50:58 +00:00
Chris Lattner ac7ed9a71a move __FLT_EVAL_METHOD__, __FLT_RADIX__, and __DECIMAL_DIG__ into
target indep code.

llvm-svn: 57139
2008-10-05 21:49:27 +00:00
Chris Lattner c34a35d56f it helps when I save the file before testing and committing.
llvm-svn: 57138
2008-10-05 21:42:17 +00:00
Chris Lattner 6da2f0dd2e suck the rest of the FP macros out of the targets into the PP
llvm-svn: 57137
2008-10-05 21:40:58 +00:00
Chris Lattner 5cd8351808 start moving fp macros over
llvm-svn: 57134
2008-10-05 20:40:30 +00:00
Chris Lattner 6512a88984 move a bunch more integer sizing out of target-specific code into
target indep code.  

Note that this changes functionality on PIC16: it defines __INT_MAX__
correctly for it, and it changes sizeof(long) to 16-bits (to match
the size of pointer).

llvm-svn: 57132
2008-10-05 20:06:37 +00:00
Chris Lattner 4ecd753486 eliminate __USER_LABEL_PREFIX__ from the Targets.cpp file, start moving
integer size #defines over to the Preprocessor.

llvm-svn: 57130
2008-10-05 19:44:25 +00:00
Chris Lattner f37bafc5ca Implement PR2773, support for __USER_LABEL_PREFIX__
llvm-svn: 57127
2008-10-05 19:22:37 +00:00
Chris Lattner 97d749464d Handle minor version numbers in __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
like "10.3.9"

llvm-svn: 56873
2008-09-30 20:30:12 +00:00
Nick Lewycky e275a66538 Add missing include for use of atoi.
llvm-svn: 56836
2008-09-30 07:18:57 +00:00
Chris Lattner b3793bb415 The definition of __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ follows
the target triple on darwin.  For example i386-apple-darwin9 -> 1050 because
darwin9 is "10.5".

llvm-svn: 56826
2008-09-30 01:00:25 +00:00
Chris Lattner 7ed3209332 define __PASCAL_STRINGS__ whenever -fpascal-strings is enabled.
llvm-svn: 56824
2008-09-30 00:48:48 +00:00
Chris Lattner 006579ddb5 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ is a darwin-specific #define
llvm-svn: 56822
2008-09-30 00:46:39 +00:00
Chris Lattner d9a663aeb9 Make some methods const, add some helpers to FullSourceLoc,
and add a dump method to FullSourceLoc!  Patch by Nico Weber!

llvm-svn: 56806
2008-09-29 21:46:13 +00:00
Nico Weber 378c5539c8 whitespace and comment changes, to fix grammar and 80 col violations
llvm-svn: 56776
2008-09-29 00:25:48 +00:00
Chris Lattner b03dc76499 clean up a bunch of fixme's I added, by moving
DirectoryLookup::DirType into SourceManager.h

llvm-svn: 56692
2008-09-26 21:18:42 +00:00
Chris Lattner c88a23e8d7 Fix the rest of rdar://6243860 hopefully. This requires changing FileIDInfo
to whether the fileid is a 'extern c system header' in addition to whether it
is a system header, most of this is spreading plumbing around.  Once we have that,
PPLexerChange bases its "file enter/exit" notifications to PPCallbacks to
base the system header state on FileIDInfo instead of HeaderSearch.  Finally,
in Preprocessor::HandleIncludeDirective, mirror logic in GCC: the system headerness
of a file being entered can be set due to the #includer or the #includee.

llvm-svn: 56688
2008-09-26 20:12:23 +00:00
Daniel Dunbar d0921de8b0 Add x86_64 Linux target.
- PR2824

llvm-svn: 56491
2008-09-23 17:37:57 +00:00
Daniel Dunbar 84b70f7f0f Add --suppress-system-warnings (on by default, use =0 to disable)
- For investigating warnings in system headers / builtins.
 - Currently also enables the behavior that allows silent redefinition
   of types in system headers. Conceptually these are separate but I
   didn't feel it was worth two options (or changing LangOptions).

llvm-svn: 56163
2008-09-12 18:10:20 +00:00