Commit Graph

73 Commits

Author SHA1 Message Date
Daniel Dunbar 3241d400c8 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.

llvm-svn: 95787
2010-02-10 18:49:11 +00:00
Douglas Gregor aa98ed9a07 Extend clang_createTranslationUnitFromSourceFile() to support creating
translation units that include unsaved files.

llvm-svn: 94258
2010-01-23 00:14:00 +00:00
Chandler Carruth 26b29a0892 Move the MacroBuilder utilitiy to its own header. Update references.
Comments and/or improvements to the documentation are welcome.

llvm-svn: 93982
2010-01-20 06:13:02 +00:00
Daniel Dunbar 415763612a Fix an invalid Twine use spotty by abbeyj, it isn't safe to use Twine
temporaries (this is one reason I'm nervous about propagating their use beyond
particularly performance critical places).

llvm-svn: 93981
2010-01-20 06:09:53 +00:00
Fariborz Jahanian 3f7b8b274d Predefine __weak attribute when doing objective-c
rewriting for any target. (refixes radar 7530235).

llvm-svn: 93331
2010-01-13 18:51:17 +00:00
Daniel Dunbar d281a7146a Fix PR5982, a refacto in checking for '=' in a -D argument.
llvm-svn: 93088
2010-01-10 00:46:21 +00:00
Benjamin Kramer 2d6fda3205 Use MacroBuilder for TargetDefines instead of std::vector.
llvm-svn: 93058
2010-01-09 17:55:51 +00:00
Benjamin Kramer 3f6323dea5 Move MacroBuilder into Frontend/Utils.h and clean it up a bit.
llvm-svn: 93057
2010-01-09 17:43:21 +00:00
Benjamin Kramer f65e959035 Rework InitPreprocessor to use a MacroBuilder class instead of pushing around
std::vectors.

- MacroBuilder wraps a raw_ostream so it can easily write to any buffer
  supported by raw_ostream.
- MacroBuilder's method take Twines for easy string concatenation (this was done
  with sprintf and temporary buffers before).
- Targets still use std::vector as they don't have access to the builder.

llvm-svn: 93051
2010-01-09 16:17:37 +00:00
Kovarththanan Rajaratnam e8ed5be89f Switch UndefineBuiltinMacro() over to using StringRef
llvm-svn: 93049
2010-01-09 09:31:32 +00:00
Kovarththanan Rajaratnam 2f14619d89 Switch DefineBuiltinMacro() over to using StringRef
llvm-svn: 93048
2010-01-09 09:27:11 +00:00
Kovarththanan Rajaratnam 49c8da95a3 Convert from char pointer to char array
llvm-svn: 92923
2010-01-07 18:11:14 +00:00
Kovarththanan Rajaratnam b53c7d4d9d Tigthen scope of local char array
llvm-svn: 92917
2010-01-07 16:01:54 +00:00
Steve Naroff f0df20a5ba Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=70926

llvm-svn: 90596
2009-12-04 21:29:41 +00:00
Daniel Dunbar 6dac935b1f Fix two more diagnostic-on-stderr instances that thought they could hide from me -- they thought wrong.
llvm-svn: 90442
2009-12-03 09:14:12 +00:00
Douglas Gregor 407e2124bf 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.

llvm-svn: 90329
2009-12-02 18:12:28 +00:00
Douglas Gregor 6ae34abd1b Move file-remapping logic into InitPreprocesor. No functionality change
llvm-svn: 90322
2009-12-02 16:32:41 +00:00
Rafael Espindola f8a04a1d6e Exit the command line into <built-in> instead of going directly from the command line to the input file.
We passed <built-in> on the way in, so we should pass it again on the way out.

llvm-svn: 90250
2009-12-01 18:28:16 +00:00
Ken Dyck adc8511bc8 Define __SIG_ATOMIC_WIDTH__ for use in stdint.h.
llvm-svn: 89597
2009-11-22 15:41:04 +00:00
Ken Dyck 0138b9e1db Define __WCHAR_WIDTH__ for use in stdint.h.
llvm-svn: 89353
2009-11-19 15:47:58 +00:00
Ken Dyck a1f677c3d1 Add __WINT_WIDTH__ to paramaterize the limits of WINT_MIN and WINT_MAX in
stdint.h.

llvm-svn: 89348
2009-11-19 14:16:57 +00:00
Ken Dyck 575128656e Add __SIZE_WIDTH__ to eventually replace __SIZE_TYPE__ in stdint.h.
llvm-svn: 89346
2009-11-19 13:42:09 +00:00
Ken Dyck 9b25f781c5 Restore __INTMAX_TYPE__, __UINTMAX_TYPE__, __PTRDIFF_TYPE__, and
__INTPTR_TYPE__ as the last is used in the test/CodeGen/const-init.c and all
could potentially be in use in the wild. My apologies.

llvm-svn: 89345
2009-11-19 13:18:59 +00:00
Ken Dyck f982fc0b23 Remove __PTRDIFF_TYPE__ as it is no longer needed by stdint.h. It has been
replaced with __PTRDIFF_WIDTH__.

llvm-svn: 89344
2009-11-19 12:37:14 +00:00
Ken Dyck 056efe0fc7 Add __PTRDIFF_WIDTH__ macro to eventually replace __PTRDIFF_TYPE__ in stdint.h.
llvm-svn: 89342
2009-11-19 12:21:52 +00:00
Ken Dyck cc11129fda Remove __INTPTR_TYPE__ as it is no longer needed by stdint.h, which uses
__INTPTR_WIDTH__ instead.

llvm-svn: 89340
2009-11-19 12:15:31 +00:00
Ken Dyck 24cfcf15c3 Predefine __INTPTR_WIDTH__ for future use in stdint.h.
llvm-svn: 89231
2009-11-18 20:05:48 +00:00
Ken Dyck fa01168a5c Remove the __INTMAX_TYPE__ and __UINTMAX_TYPE__ built-in macros as they are no
longer used by stdint.h.

llvm-svn: 89230
2009-11-18 19:51:06 +00:00
Ken Dyck c0c98291e0 Predefine __INTMAX_WIDTH__ for the future parameterization of INTMAX macros in
stdint.h.

llvm-svn: 89203
2009-11-18 13:52:57 +00:00
Daniel Dunbar d6ea9028e7 Simplify PreprocessorOptions, it doesn't need abstracted field access.
llvm-svn: 89047
2009-11-17 05:52:41 +00:00
Ken Dyck 2dc8d5fa3e Parameterize the constant-generating macros in stdint.h with new built-in
__INTn_C_SUFFIX__ macros that are defined for types with corresponding
constant suffixes (i.e. long and long long).

llvm-svn: 88914
2009-11-16 16:36:33 +00:00
Chris Lattner 55c9877b66 Generalize stdint.h for non-8-bit-multiple types, patch by
Ken Dyck!

"This adds definitions for types of 8-bit multiples
from 8 to 64 to stdint.h and rationalizes the selection of types 
for the exact-width definitions in InitPreprocessor.cpp."

llvm-svn: 86977
2009-11-12 08:08:27 +00:00
Chris Lattner 0fb5bbd401 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!

llvm-svn: 86976
2009-11-12 08:04:33 +00:00
Daniel Dunbar 732ef8aefd Tweak PCH -include handling to make sure it matches the name as would be present
in the predefines buffer.

llvm-svn: 86903
2009-11-11 23:58:53 +00:00
Daniel Dunbar 2856ae444b Always initialize the header search object as part of InitializePreprocessor;
not doing this has little to no utility.

llvm-svn: 86883
2009-11-11 21:44:42 +00:00
Daniel Dunbar de02f63945 PreprocessorOptions: Get rid of unnecessary 'isPTH' flag for include entries.
llvm-svn: 86757
2009-11-10 23:53:43 +00:00
Daniel Dunbar 00f8a397c6 Rename PreprocessorInitOptions to PreprocessorOptions for consistency, and fix
filenames.

Also, move InitializePreprocessor to Utils.h.

llvm-svn: 86335
2009-11-07 04:20:15 +00:00
Chris Lattner e4a8c64731 clean up integer preprocessor type definitions, patch by Ken Dyck!
llvm-svn: 86177
2009-11-05 21:21:32 +00:00
Daniel Dunbar 181aaee165 InitializePreprocessor cannot fail.
llvm-svn: 86048
2009-11-04 21:13:15 +00:00
Daniel Dunbar b27ec09a7e Move -undef flag into PreprocessorInitOptions
llvm-svn: 86047
2009-11-04 21:13:02 +00:00
Chris Lattner e9d7d78ab3 Implement support for the -undef command line option, patch by
Roman Divacky! PR5363

llvm-svn: 85932
2009-11-03 19:50:27 +00:00
Chris Lattner 3fab58d867 clean up namespace.
llvm-svn: 85826
2009-11-02 21:48:09 +00:00
Chris Lattner d0952749f7 simplify intmax setup, patch by Ken Dyck!
llvm-svn: 85481
2009-10-29 04:54:24 +00:00
Chris Lattner 6720492c39 hookize wint_t's definition, patch by Edward O'Callaghan (from PR5233).
llvm-svn: 84740
2009-10-21 04:59:34 +00:00
John Thompson 1faca9e0fb Work-around wchar_t and __pragma problem in VC headers
llvm-svn: 84227
2009-10-16 01:12:00 +00:00
Rafael Espindola 00a665751d Move the "needs exception support" logic to clang. This also fixes
-fno-exceptions in C++ code. We used to always define __EXCEPTIONS in
C++.

llvm-svn: 83199
2009-10-01 13:33:33 +00:00
Fariborz Jahanian 2cde203392 Non fragile ABI for GNU runtime. Patch bu David Chisnall.
llvm-svn: 81462
2009-09-10 21:48:21 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Daniel Dunbar fe07aecd37 Don't use '%ll', this doesn't workin on Win32.
llvm-svn: 80933
2009-09-03 19:23:49 +00:00
Eli Friedman 80110179f4 Define _GNU_SOURCE in C++ mode so that clang works with GNU libstdc++.
llvm-svn: 80289
2009-08-27 22:01:41 +00:00