| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
can be provided by using Preprocessor::isBacktrackEnabled().
llvm-svn: 59631
|
|
|
|
| |
llvm-svn: 59573
|
|
|
|
| |
llvm-svn: 59554
|
|
|
|
|
|
| |
methods.
llvm-svn: 59511
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
ownership semantics of these objects explicit within the Preprocessor and also tightens up the code (explicit deletes not needed).
llvm-svn: 59249
|
|
|
|
| |
llvm-svn: 58503
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
won't expand to the builtin. This fixes rdar://6248329
llvm-svn: 57164
|
|
|
|
|
|
| |
target indep code.
llvm-svn: 57139
|
|
|
|
| |
llvm-svn: 57137
|
|
|
|
| |
llvm-svn: 57134
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
integer size #defines over to the Preprocessor.
llvm-svn: 57130
|
|
|
|
| |
llvm-svn: 57129
|
|
|
|
|
|
| |
then target specific.
llvm-svn: 57128
|
|
|
|
| |
llvm-svn: 57127
|
|
|
|
| |
llvm-svn: 56824
|
|
|
|
| |
llvm-svn: 56822
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
- This really needs to be automated and configurable.
llvm-svn: 56635
|
|
|
|
| |
llvm-svn: 56503
|
|
|
|
|
|
| |
- Replace FIXME in Preprocessor::HandleIdentifier() with a check that avoids diagnosing extension tokens that originate from macro definitions.
llvm-svn: 55639
|
|
|
|
| |
llvm-svn: 55637
|
|
|
|
| |
llvm-svn: 55635
|
|
|
|
|
|
| |
Make sure there's no "dangling" backtrack position when Preprocessor is destroyed.
llvm-svn: 55236
|
|
|
|
|
|
|
| |
InitializePredefinedMacros().
- Also now properly wired to -fobjc-gc, -fnext-runtime.
llvm-svn: 54661
|
|
|
|
| |
llvm-svn: 54652
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Move FormatError() from TextDiagnostic up to DiagClient, remove now
empty class TextDiagnostic
* Make DiagClient optional for Diagnostic
This fixes the following problems:
* -html-diags (and probably others) does now output the same set of
warnings as console clang does
* nothing crashes if one forgets to call setHeaderSearch() on
TextDiagnostic
* some code duplication is removed
llvm-svn: 54620
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
efficient lookahead and backtracking.
1) New public methods added:
-EnableBacktrackAtThisPos
-DisableBacktrack
-Backtrack
-isBacktrackEnabled
2) LookAhead() implementation is replaced with a more efficient one.
3) LookNext() is removed.
llvm-svn: 54611
|
|
|
|
|
|
|
| |
"When dumping the tokens (-dumptokens output type), the column numbers are not
correctly shown. This patch fixes that issue."
llvm-svn: 53796
|
|
|
|
|
|
| |
really belongs
llvm-svn: 53149
|
|
|
|
|
|
| |
build of libtidy
llvm-svn: 53145
|
|
|
|
|
|
|
| |
Additionally, define __clang__ so clients can predicate based on
clang features.
llvm-svn: 52788
|
|
|
|
|
|
|
|
| |
__CFConstantStringClassReference[];" should be extern "C".
Have clang predefine OBJC_NEW_PROPERTIES (which is what gcc does).
llvm-svn: 51163
|
|
|
|
|
|
| |
when targeting the new, Apple 2.0 *runtime ABI*. It is not intended to be used to #ifdef ObjC 2.0 langauge features. This is unfortunate (given it's name). In a perfect world, this defined would be named __OBJC2_RUNTIME_ABI__. Oh well.
llvm-svn: 50913
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
related to pp-expressions. Doing so is pretty simple and this
patch implements it, yielding nice diagnostics like:
t.c:2:7: error: division by zero in preprocessor expression
#if 1 / (0 + 0)
~ ^ ~~~~~~~
t.c:5:14: error: expected ')' in preprocessor expression
#if (412 + 42
~~~~~~~~^
t.c:5:5: error: to match this '('
#if (412 + 42
^
t.c:10:10: warning: left side of operator converted from negative value to unsigned: -42 to 18446744073709551574
#if (-42 + 0U) / -2
~~~ ^ ~~
t.c:10:16: warning: right side of operator converted from negative value to unsigned: -2 to 18446744073709551614
#if (-42 + 0U) / -2
~~~~~~~~~~ ^ ~~
5 diagnostics generated.
llvm-svn: 50638
|
|
|
|
| |
llvm-svn: 49973
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dstor.
clang.cpp: InitializePreprocessor now makes a copy of the contents of PredefinesBuffer and
passes it to the preprocessor object.
clang.cpp: DriverPreprocessorFactory now calls "InitializePreprocessor" instead of this being done in main().
html::HighlightMacros() now takes a PreprocessorFactory, allowing it to conjure up a new
Preprocessor to highlight macros.
class HTMLDiagnostics now takes a PreprocessorFactory* that it can use for html::HighlightMacros().
Updated clients of HTMLDiagnostics to use this new interface.
llvm-svn: 49875
|
|
|
|
|
|
| |
objects on-demand.
llvm-svn: 49868
|
|
|
|
| |
llvm-svn: 48485
|
|
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.
llvm-svn: 48402
|