Граф коммитов

543 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 36c35ba0ac Use SourceManager's Diagnostic object for all file-reading errors,
simplifying the SourceManager interfaces somewhat.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 00:35:39 +00:00
Douglas Gregor f715ca12bf Give SourceManager a Diagnostic object with which to report errors,
and start simplifying the interfaces in SourceManager that can fail.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 00:06:06 +00:00
Douglas Gregor f9b0a58a10 Add some <cstdio> includes to unbreak the buildbots
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98591 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 23:33:37 +00:00
Douglas Gregor aea67dbd65 Introduce a new BufferResult class to act as the return type of
SourceManager's getBuffer() (and similar) operations. This abstract
can be used to force callers to cope with errors in getBuffer(), such
as missing files and changed files. Fix a bunch of callers to use the
new interface.

Add some very basic checks for file consistency (file size,
modification time) into ContentCache::getBuffer(), although these
checks don't help much until we've updated the main callers (e.g.,
SourceManager::getSpelling()).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98585 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 22:54:52 +00:00
Kovarththanan Rajaratnam 50acf24b71 Reintroduce r98340 and r98341 now without copy/paste errors.
Thanks to Ben for pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98345 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 11:27:37 +00:00
Kovarththanan Rajaratnam 6561adf16d Back out r98340 abd r98341
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 11:00:51 +00:00
Nuno Lopes 33d3bcac0b fix PR6584: __SSE3__ not defined with -mss3
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98342 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 10:20:09 +00:00
Kovarththanan Rajaratnam f9bc110857 Switch parameter order for consistency (no functionality change)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 10:17:07 +00:00
Kovarththanan Rajaratnam 362f6f2d57 Add keywords using StringRef
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98340 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 10:14:26 +00:00
Ted Kremenek 8515fbf1a1 Fix -Wsign-compare warning reported by clang++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 18:22:38 +00:00
Chris Lattner 9cbeb63901 add mblaze target support, patch by Wesley Peck!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97890 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 21:21:27 +00:00
Benjamin Kramer 940f646548 Make sure the raw_string_ostream gets flushed so we don't accidentally return an empty string.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97809 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 15:39:20 +00:00
Chris Lattner 3a47c4e0a3 add TCE target support, patch by Pekka J!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 21:07:38 +00:00
Eric Christopher d41b4ec580 Add in disabled case as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97716 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 02:31:44 +00:00
Eric Christopher d39ebe2d2a Add in -msse4.1 and -msse4.2 options and continuing a rather
hacky solution for translating.  Expanded on comment explaining
the hack a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97714 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 02:26:37 +00:00
Chris Lattner 2752c0137d add framework for ARM builtins, Patch by Edmund Grimley Evans!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97656 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 19:03:45 +00:00
Ted Kremenek ec5008807b Use SVN_REVISION, not SVN_VERSION.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97625 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:30:39 +00:00
Ted Kremenek 971cc48dca Make getClangRevision() check that SVN_VERSION is an empty string
(even if it is defined).  This fixes the issue of this function
returning '0' when SVN_VERSION is defined to be "".

Fixes: <rdar://problem/7663667>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97620 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:02:48 +00:00
Eric Christopher ed734737d5 Add in some more MIPS command line options.
Patch by Oleksandr Tymoshenko!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97544 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 02:41:08 +00:00
Douglas Gregor d1eabfb15c Robustify SourceManager::getLocation(), so that it returns an
end-of-line source location when given a column number beyond the
length of the line, or an end-of-file source location when given a
line number beyond the length of the file. Previously, we would return
an invalid location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 02:42:25 +00:00
Douglas Gregor b9c903bc7c Use a little binary header in serialized diagnostics to help the deserializer skip over noise in the stream
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96641 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 00:40:40 +00:00
Douglas Gregor 0a812cf707 Re-apply my diagnostics-capture patch for CIndex, with some tweaks to
try to address the msvc failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96624 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 23:07:20 +00:00
Douglas Gregor a88084b78f Rework how CIndex handles diagnostics. Rather than using a callback,
we attach diagnostics to translation units and code-completion
results, so they can be queried at any time.

To facilitate this, the new StoredDiagnostic class stores a diagnostic
in a serializable/deserializable form, and ASTUnit knows how to
capture diagnostics in this stored form. CIndex's CXDiagnostic is a
thin wrapper around StoredDiagnostic, providing a C interface to
stored or de-serialized diagnostics.

I've XFAIL'd one test case temporarily, because currently we end up
storing diagnostics in an ASTUnit that's never returned to the user
(because it contains errors). I'll introduce a temporary fix for this
soon; the real fix will be to allow us to return and query invalid ASTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 18:08:43 +00:00
Chris Lattner e03ae30bc2 add freebsd/ppc[64] support, patch by Nathan Whitehorn, PR6318
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96362 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 18:14:57 +00:00
Sanjiv Gupta fcd302b5e4 Re-applying 96173. Looks like finally I got the test case right.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96321 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 03:37:11 +00:00
Sanjiv Gupta 5591a6b5a8 reverting back 96242 as it still causes a test failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 18:02:12 +00:00
Sanjiv Gupta aed63cbe10 Re-applying 96173 with corresponding changes in test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 17:19:13 +00:00
Chris Lattner 94baf7fc05 temporarily revert 96173, it is causing test failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 18:38:38 +00:00
Sanjiv Gupta a5999e2a51 renamed pic16 specifiic macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96173 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 18:20:18 +00:00
Ted Kremenek 974be4d50a Fix bug I introduced with assinging a temporary to a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96041 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 23:31:14 +00:00
Ted Kremenek a2a9d6e4e5 Make the following functions thread-safe but having them return an std::string that is reconstructed
every time they are called:

getClangRevision()
getClangFullRepositoryVersion()
getClangFullVersion()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96033 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 22:54:40 +00:00
Chris Lattner a5c6c5814b fix a bug in SourceManager::getInstantiationLocSlowCase, where
we'd add an offset from the spelling location space to the 
instantiation location, which doesn't make sense and would
lead up to the text diagnostics crashing when presented with
non-sensical locations.

This fixes rdar://7597492, a crash on 255.vortex.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96004 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 19:31:35 +00:00
John McCall 779cf424a1 Suppress warnings if their instantiation location is in a system header, not
their spelling location.  This prevents warnings from being swallowed just
because the caret is on the first parenthesis in, say, NULL.

This is an experiment;  the risk is that there might be a substantial number
of system headers which #define symbols to expressions which inherently cause
warnings.  My theory is that that's rare enough that it can be worked
around case-by-case, and that producing useful warnings around NULL is worth 
it.  But I'm willing to accept that I might be empirically wrong.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 10:04:29 +00:00
Daniel Dunbar b2987d159a Switch to using -fsjlj-exceptions instead of hard-coding it. Notably, this fixes
calls to the UnwindResumeOrRethrow function for C++/Obj-C exception handling,
for Darwin ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 18:49:11 +00:00
John Thompson 82287d19de First stage of adding AltiVec support
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95335 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 00:12:22 +00:00
Chris Lattner b9f709665a Don't explicitly force utf strings into the __TEXT,__ustring
by setting the section of the generated global.  This is an
optimization done by the code generator, and the code being
removed didn't handle the case when the string contained an
embedded nul (which the code generator does correctly 
handle).  This is rdar://7589850



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 20:59:08 +00:00
Benjamin Kramer 3bb6530019 Simplify FreeBSD version parsing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 19:55:01 +00:00
Anders Carlsson 83c021c6d3 Yay for more StringRefs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 19:12:25 +00:00
Anders Carlsson f959fb5fb8 StringRef-ize the TargetInfo::ConstraintInfo constructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 18:33:31 +00:00
Benjamin Kramer e242d5f5fa We don't need to place 0 in the URL string now that we return a StringRef.
- URL can go into read only memory now.
- Compilers will fold away all the strstr calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 14:01:39 +00:00
Anton Korobeynikov 09f52a696e Fix alignment for msp430 integer types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 12:55:11 +00:00
Douglas Gregor d93256e556 Introduce serialization and deserialization of diagnostic information
so that CIndex can report diagnostics through the normal mechanisms
even when executing Clang in a separate process. This applies both
when performing code completion and when using ASTs as an intermediary
for clang_createTranslationUnitFromSourceFile().

The serialized format is not perfect at the moment, because it does
not encapsulate macro-instantiation information. Instead, it maps all
source locations back to the instantiation location. However, it does
maintain source-range and fix-it information. To get perfect fidelity
from the serialized format would require serializing a large chunk of
the source manager; at present, it isn't clear if this code will live
long enough for that to matter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 06:00:51 +00:00
Daniel Dunbar d410fa259e ARM/APCS: Fix alignment of long double.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94685 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 20:23:08 +00:00
Anders Carlsson 9b0fb629fd Add support for 3dnow and 3dnowa, and define the target macros accordingly. (This is needed in order to build Qt).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94658 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 03:47:49 +00:00
Daniel Dunbar 21ae3196c9 Driver/Darwin: Stuff iPhoneOS into environment portion of the (llvm/clang) triple instead of keying off architecture. Also, fix version define to properly include the revision/micro component of the version number.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94487 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 01:44:04 +00:00
Chris Lattner 0bb46d285c -fno-rtti is now the default.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 20:43:31 +00:00
Ted Kremenek a18f1b88a7 Rename getClangFullVendorVersion() to getClangFullVersion().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94273 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 02:11:34 +00:00
Ted Kremenek 04bb716aea Add 'clang_getClangVersion()' function to CIndex. This exposes the full Clang version string through the CIndex API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:44:15 +00:00
Ted Kremenek 3687a5d83f Move version string generation (e.g., "clang 1.1 ...") to libBasic/Version.cpp, getClangFullVendorVersion().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:29:50 +00:00
Ted Kremenek f7a96a3995 (1) Rename getClangSubversionRevision() to getClangRevision(), and
have it return a StringRef instead of an integer (to be more VCS
    agnostic).

(2) Add getClangFullRepositoryVersion(), which contains an
    amalgamation of the repository name and the revision.

(3) Change PCH to only emit the string returned by
    getClangFullRepositoryVersion() instead of also emitting the value
    of getClangSubversionRevision() (which has been removed).  This is
    functionally equivalent.

More cleanup to version string generation pending...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94231 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:12:47 +00:00
Ted Kremenek 517e676b9e Rename getClangSubversionPath() -> getClangRepositoryPath() and have it return a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94213 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 20:55:35 +00:00
Daniel Dunbar 38474aa780 Update to use llvm/utils/GetSourceVersion to detect version number, instead of
assuming SVN. This should be fixed to not necessarily be an integer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 16:56:47 +00:00
Chandler Carruth 103b71c37a Move the MacroBuilder utilitiy to its own header. Update references.
Comments and/or improvements to the documentation are welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 06:13:02 +00:00
Chandler Carruth b3ee1df5a4 Actually remove the include that r93974 made unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 04:09:11 +00:00
Anton Korobeynikov 26d18c1e18 long long is 64 bits on msp430
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93451 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 20:22:45 +00:00
John McCall 909c182f6a Pre-emptive bugfixes in the diagnostics code: allow arbitrary punctuation
characters to be escaped and implement a scan-forward function which
properly respects brace nesting.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93447 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 20:11:39 +00:00
John McCall 3be16b7d9d Add the %ordinal format modifier for turning '1' into '1st'. Hard-coded for
English right now;  would not be impossible to grab a special format string
from the diagnostic pool and localize that way.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 00:50:32 +00:00
John McCall 9f28614bf1 Perform format-expansion on %select results.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 23:58:20 +00:00
Fariborz Jahanian 7d957472ef Predefine __weak attribute when doing objective-c
rewriting for any target. (refixes radar 7530235).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93331 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 18:51:17 +00:00
Fariborz Jahanian 453c1349a5 Define __weak attribute for objective-c pointers in
win32 targets. Fixes radar 7530235. Daniel please review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93246 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 18:33:57 +00:00
Benjamin Kramer 4872508294 Hopefully unbreak build with g++ >= 4.3.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93060 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 18:20:57 +00:00
Benjamin Kramer a99927774d Use MacroBuilder for TargetDefines instead of std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 17:55:51 +00:00
Chris Lattner 7a7ca281bc improve support for dragonfly, patch by Sascha Wildner!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 05:41:14 +00:00
Nuno Lopes 2550d70aab move a few more symbols to .rodata/.data.rel.ro
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:49:57 +00:00
Chris Lattner e663c72006 implement -W[no-]fatal-errors, patch by Christian Adåker!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 23:12:53 +00:00
Daniel Dunbar 5affb539ac ARM: Remove a FIXME, it's not actually more complicated than that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91924 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 21:59:17 +00:00
Daniel Dunbar a91320b8af ARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".
- Correctly is in quotes, because we are following what I interpreted as GCC's
   intent (which diverges from practice, naturally).
 - Also, fix the arch define for arm1136jf-s.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91855 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 23:28:17 +00:00
Daniel Dunbar 97f52ac453 ARM: Use front-end specific target features "soft-float" and "soft-float-abi" to communicate FP mode to target; __SOFTFP__ is set correctly now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 04:15:38 +00:00
Daniel Dunbar b93292ab7f Targets: Allow CreateTargetInfo to mutate the target features.
- In particular, it can claim features for itself instead of always passing them on to LLVM.
 - This allows using the target features as a generic mechanism for passing target specific options to the TargetInfo instance, which may need them for initializing preprocessor defines, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 03:30:57 +00:00
Anton Korobeynikov b381441bfb Add f80 entry for windows targets
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 02:05:07 +00:00
Anton Korobeynikov 5d7c2511a4 Use proper alignment for i16/i32 on msp430. This fixes PR5815.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 01:32:37 +00:00
Daniel Dunbar 0791aa52b6 ARM: Define __thumb2__ for V6T2 targets and only define
__USING_SJLJ_EXCEPTIONS__ on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 19:57:13 +00:00
Daniel Dunbar eac7c53f16 ARM: Fix predefines (__ARM_ARCH_..., __REGISTER_PREFIX).
- This should be done leveraging the backend, but I'm a little refactored
   out. I'll fix it one day, I promise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91700 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 18:42:37 +00:00
John Thompson ec387afb60 Tweaks for PS3 target.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 14:21:08 +00:00
John Thompson 9a6ac540ba Removing trailing directory separator, to make stat work
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 14:18:21 +00:00
Nuno Lopes aa8e36108f fix PR5689: add support for 'o' and 'V' asm input operands
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 14:28:21 +00:00
Daniel Dunbar 475ddb4547 FileManager: Do not cache failed stats, it is easy to construct common
inconsistent situations if we do, and they are not important for PCH performance
(which currently only needs the stats to construct the initial FileManager
entries).
 - No test case, sorry, the machinations are too involved.

This occurs when, for example, the build makes a PCH file and has a header map
or a -I for a directory that does not yet exist. It is possible we will cache
the negative stat on that directory, and then in the build we will never find
header files inside that dir.

For PCH we don't need these stats anyway for performance, so this also makes PCH
files smaller w/ no loss. I hope to eventually eliminate the stat cache
entirely.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 00:27:20 +00:00
Daniel Dunbar 21a8bed504 Add a pretty horrible hack to prevent clang from crashing with inconsistent PCH
files.
 - The issue is that PCH uses a stat cache, which may reference files which have
   been deleted or moved. In such cases ContentCache::getBuffer was returning 0
   but most clients are incapable of dealing with this (i.e., they don't).

   For the time being, resolve this issue by just making up some invalid file
   contents and. Eventually we should detect that we are in an inconsistent
   situation and error out with a nice message that the PCH is out of date.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90699 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 05:43:36 +00:00
Steve Naroff 0304c6cb7f Remove 'LangOpts' from Diagnostic (added in http://llvm.org/viewvc/llvm-project?view=rev&revision=90642).
Simply use the 'LangOpts' member already present in TextDiagnosticPrinter.

Sorry for the confusion!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 12:23:07 +00:00
Steve Naroff e0c4d895ff Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71086

Note - This commit only includes the fix for:

<rdar://problem/6309338> slightly different error message format for Visual Studio.

The fix for <rdar://problem/6845623> from protocol to template. is separate/forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 02:14:08 +00:00
Douglas Gregor 109ae73ec7 Minor cleanup to the code-completion-point logic suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 17:05:59 +00:00
Douglas Gregor 057e567f1b Extend -remap-file=from;to to permit mapping from a non-existent
file. This is accomplished by introducing the notion of a "virtual"
file into the file manager, which provides a FileEntry* for a named
file whose size and modification time are known but which may not
exist on disk.

Added a cute little test that remaps both a .c file and a .h file it
includes to alternative files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 18:12:28 +00:00
Douglas Gregor 2968442603 Extend the source manager with the ability to override the contents of
files with the contents of an arbitrary memory buffer. Use this new
functionality to drastically clean up the way in which we handle file
truncation for code-completion: all of the truncation/completion logic
is now encapsulated in the preprocessor where it belongs
(<rdar://problem/7434737>).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90300 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 06:49:09 +00:00
Douglas Gregor 4a160e16eb Eliminate the unnecessary FirstFID cache variable from the source manager's ContentCache
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90294 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 05:34:39 +00:00
Daniel Dunbar fbcc7bed1a In SourceManager::isBeforeInTranslationUnit, if we are trying to compare two source locations with no common ancestor in the include stack, determine order by assuming memory buffers preceed files, and then that FileIDs are created in order.
The later assumption is patently false, but this was already broken -- this situation is conceptually impossible, my feeling is we should fix SourceManager and friends to make it impossible in practice as well. However, we need to fix PR5662 and perhaps some other things involving memory buffers first. In the short term I'm pretty sure this is reliable.

Chris, Argiris, is this going to break anything that wasn't already broken?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90280 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 23:07:57 +00:00
Chris Lattner 39d9841ed4 pass the reason for failure up from MemoryBuffer and report it
in diagnostics when we fail to open a file.  This allows us to
report things like:

$ clang test.c -I.
test.c:2:10: fatal error: error opening file './foo.h': Permission denied
#include "foo.h"
         ^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 22:52:33 +00:00
Daniel Dunbar 32d4d80c26 Convert Diagnostic::getCustomDiagID to take a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90244 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 17:42:06 +00:00
Kovarththanan Rajaratnam 59c55e7249 This patch adds a PUNCTUATOR macro (specialization of TOK) in TokenKinds.def and makes use of it in tok::getTokenSimpleSpelling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28 16:09:28 +00:00
Edward O'Callaghan 9cf910efc4 Add SigAtomicType to TargetInfo, Needed for MSP and PIC Targets, Credit to Ken Dyck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 00:49:54 +00:00
John Thompson 3f6918a8cc Added preliminary support step for PS3
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 17:18:50 +00:00
Daniel Dunbar 2fc430d548 Eliminate TargetInfo::getDefaultLangOptions, this kind of logic is better done
in the driver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 09:15:44 +00:00
Daniel Dunbar c5a97ec194 Move -fnext-runtime defaulting to driver (and change clang-cc default to
-fnext-runtime), instead of using getDefaultLangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 07:07:28 +00:00
Daniel Dunbar 0be42c44f0 Move -fms-extensions defaulting to driver, instead of using getDefaultLangOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89057 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 07:06:20 +00:00
Daniel Dunbar 1f95e6567f Move char-is-signed defaulting to driver, instead of using
getDefaultLangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 06:37:03 +00:00
Edward O'Callaghan 84423a8c84 Add MIPS support to Triple for Linux and the PSP. Credit to Bruno Cardoso Lopes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88850 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 10:22:07 +00:00
Daniel Dunbar d58c03f42e Add TargetOptions and use it when constructing targets.
- This ended up being hard to factor, sorry for the large diff.

 - Some post-commit cleanup to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 06:48:46 +00:00
Benjamin Kramer c997eb4ac1 Move DISABLE_INLINE to the front of the decl so MSVC can parse it. Patch by Amine Khaldi!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 16:36:57 +00:00
Chris Lattner 9184646509 do not store wchar/char16/char32/intmax width/alignment info
into TargetInfo, just derive this based on the underlying type.
This prevents them from getting out of synch, patch by Ken Dyck!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 08:04:33 +00:00
Daniel Dunbar 29a790ba42 Simplifiy target feature handling by coalescing all the logic into
InitializeCompileOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86826 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 09:38:56 +00:00
Chris Lattner 1932e12d8b teach the various targets what native integer types they have.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 18:59:41 +00:00