LLVM  8.0.1
Macros | Functions
regexec.c File Reference
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <ctype.h>
#include "regex_impl.h"
#include "regutils.h"
#include "regex2.h"
#include "regengine.inc"
Include dependency graph for regexec.c:

Go to the source code of this file.

Macros

#define states1   long /* for later use in llvm_regexec() decision */
 
#define states   states1
 
#define CLEAR(v)   ((v) = 0)
 
#define SET0(v, n)   ((v) &= ~((unsigned long)1 << (n)))
 
#define SET1(v, n)   ((v) |= (unsigned long)1 << (n))
 
#define ISSET(v, n)   (((v) & ((unsigned long)1 << (n))) != 0)
 
#define ASSIGN(d, s)   ((d) = (s))
 
#define EQ(a, b)   ((a) == (b))
 
#define STATEVARS   long dummy /* dummy version */
 
#define STATESETUP(m, n)   /* nothing */
 
#define STATETEARDOWN(m)   /* nothing */
 
#define SETUP(v)   ((v) = 0)
 
#define onestate   long
 
#define INIT(o, n)   ((o) = (unsigned long)1 << (n))
 
#define INC(o)   ((o) = (unsigned long)(o) << 1)
 
#define ISSTATEIN(v, o)   (((v) & (o)) != 0)
 
#define FWD(dst, src, n)   ((dst) |= ((unsigned long)(src)&(here)) << (n))
 
#define BACK(dst, src, n)   ((dst) |= ((unsigned long)(src)&(here)) >> (n))
 
#define ISSETBACK(v, n)   (((v) & ((unsigned long)here >> (n))) != 0)
 
#define SNAMES   /* engine.inc looks after details */
 
#define states   char *
 
#define CLEAR(v)   memset(v, 0, m->g->nstates)
 
#define SET0(v, n)   ((v)[n] = 0)
 
#define SET1(v, n)   ((v)[n] = 1)
 
#define ISSET(v, n)   ((v)[n])
 
#define ASSIGN(d, s)   memmove(d, s, m->g->nstates)
 
#define EQ(a, b)   (memcmp(a, b, m->g->nstates) == 0)
 
#define STATEVARS   long vn; char *space
 
#define STATESETUP(m, nv)
 
#define STATETEARDOWN(m)   { free((m)->space); }
 
#define SETUP(v)   ((v) = &m->space[m->vn++ * m->g->nstates])
 
#define onestate   long
 
#define INIT(o, n)   ((o) = (n))
 
#define INC(o)   ((o)++)
 
#define ISSTATEIN(v, o)   ((v)[o])
 
#define FWD(dst, src, n)   ((dst)[here+(n)] |= (src)[here])
 
#define BACK(dst, src, n)   ((dst)[here-(n)] |= (src)[here])
 
#define ISSETBACK(v, n)   ((v)[here - (n)])
 
#define LNAMES   /* flag */
 
#define GOODFLAGS(f)   ((f)&(REG_NOTBOL|REG_NOTEOL|REG_STARTEND))
 

Functions

int llvm_regexec (const llvm_regex_t *preg, const char *string, size_t nmatch, llvm_regmatch_t pmatch[], int eflags)
 

Macro Definition Documentation

◆ ASSIGN [1/2]

#define ASSIGN (   d,
 
)    ((d) = (s))

Definition at line 111 of file regexec.c.

◆ ASSIGN [2/2]

#define ASSIGN (   d,
 
)    memmove(d, s, m->g->nstates)

Definition at line 111 of file regexec.c.

◆ BACK [1/2]

#define BACK (   dst,
  src,
 
)    ((dst) |= ((unsigned long)(src)&(here)) >> (n))

Definition at line 126 of file regexec.c.

◆ BACK [2/2]

#define BACK (   dst,
  src,
 
)    ((dst)[here-(n)] |= (src)[here])

Definition at line 126 of file regexec.c.

◆ CLEAR [1/2]

#define CLEAR (   v)    ((v) = 0)

Definition at line 107 of file regexec.c.

◆ CLEAR [2/2]

#define CLEAR (   v)    memset(v, 0, m->g->nstates)

Definition at line 107 of file regexec.c.

◆ EQ [1/2]

#define EQ (   a,
 
)    ((a) == (b))

◆ EQ [2/2]

#define EQ (   a,
 
)    (memcmp(a, b, m->g->nstates) == 0)

Definition at line 112 of file regexec.c.

◆ FWD [1/2]

#define FWD (   dst,
  src,
 
)    ((dst) |= ((unsigned long)(src)&(here)) << (n))

Definition at line 125 of file regexec.c.

◆ FWD [2/2]

#define FWD (   dst,
  src,
 
)    ((dst)[here+(n)] |= (src)[here])

Definition at line 125 of file regexec.c.

◆ GOODFLAGS

#define GOODFLAGS (   f)    ((f)&(REG_NOTBOL|REG_NOTEOL|REG_STARTEND))

Referenced by llvm_regexec().

◆ INC [1/2]

#define INC (   o)    ((o) = (unsigned long)(o) << 1)

Definition at line 121 of file regexec.c.

◆ INC [2/2]

#define INC (   o)    ((o)++)

Definition at line 121 of file regexec.c.

◆ INIT [1/2]

#define INIT (   o,
 
)    ((o) = (unsigned long)1 << (n))

Definition at line 120 of file regexec.c.

Referenced by llvm::cl::TokenizeWindowsCommandLine().

◆ INIT [2/2]

#define INIT (   o,
 
)    ((o) = (n))

Definition at line 120 of file regexec.c.

◆ ISSET [1/2]

#define ISSET (   v,
 
)    (((v) & ((unsigned long)1 << (n))) != 0)

Definition at line 110 of file regexec.c.

◆ ISSET [2/2]

#define ISSET (   v,
 
)    ((v)[n])

Definition at line 110 of file regexec.c.

◆ ISSETBACK [1/2]

#define ISSETBACK (   v,
 
)    (((v) & ((unsigned long)here >> (n))) != 0)

Definition at line 127 of file regexec.c.

◆ ISSETBACK [2/2]

#define ISSETBACK (   v,
 
)    ((v)[here - (n)])

Definition at line 127 of file regexec.c.

◆ ISSTATEIN [1/2]

#define ISSTATEIN (   v,
 
)    (((v) & (o)) != 0)

Definition at line 122 of file regexec.c.

◆ ISSTATEIN [2/2]

#define ISSTATEIN (   v,
 
)    ((v)[o])

Definition at line 122 of file regexec.c.

◆ LNAMES

#define LNAMES   /* flag */

Definition at line 129 of file regexec.c.

◆ onestate [1/2]

#define onestate   long

Definition at line 119 of file regexec.c.

◆ onestate [2/2]

#define onestate   long

Definition at line 119 of file regexec.c.

◆ SET0 [1/2]

#define SET0 (   v,
 
)    ((v) &= ~((unsigned long)1 << (n)))

Definition at line 108 of file regexec.c.

◆ SET0 [2/2]

#define SET0 (   v,
 
)    ((v)[n] = 0)

Definition at line 108 of file regexec.c.

◆ SET1 [1/2]

#define SET1 (   v,
 
)    ((v) |= (unsigned long)1 << (n))

Definition at line 109 of file regexec.c.

◆ SET1 [2/2]

#define SET1 (   v,
 
)    ((v)[n] = 1)

Definition at line 109 of file regexec.c.

◆ SETUP [1/2]

#define SETUP (   v)    ((v) = 0)

Definition at line 118 of file regexec.c.

◆ SETUP [2/2]

#define SETUP (   v)    ((v) = &m->space[m->vn++ * m->g->nstates])

Definition at line 118 of file regexec.c.

◆ SNAMES

#define SNAMES   /* engine.inc looks after details */

Definition at line 80 of file regexec.c.

◆ states [1/2]

#define states   states1

Definition at line 106 of file regexec.c.

◆ states [2/2]

#define states   char *

Definition at line 106 of file regexec.c.

◆ states1

#define states1   long /* for later use in llvm_regexec() decision */

Definition at line 58 of file regexec.c.

Referenced by llvm_regexec().

◆ STATESETUP [1/2]

#define STATESETUP (   m,
 
)    /* nothing */

Definition at line 114 of file regexec.c.

◆ STATESETUP [2/2]

#define STATESETUP (   m,
  nv 
)
Value:
{ (m)->space = malloc((nv)*(m)->g->nstates); \
if ((m)->space == NULL) return(REG_ESPACE); \
(m)->vn = 0; }
#define REG_ESPACE
Definition: regex_impl.h:77

Definition at line 114 of file regexec.c.

◆ STATETEARDOWN [1/2]

#define STATETEARDOWN (   m)    /* nothing */

Definition at line 117 of file regexec.c.

◆ STATETEARDOWN [2/2]

#define STATETEARDOWN (   m)    { free((m)->space); }

Definition at line 117 of file regexec.c.

◆ STATEVARS [1/2]

#define STATEVARS   long dummy /* dummy version */

Definition at line 113 of file regexec.c.

◆ STATEVARS [2/2]

#define STATEVARS   long vn; char *space

Definition at line 113 of file regexec.c.

Function Documentation

◆ llvm_regexec()

int llvm_regexec ( const llvm_regex_t preg,
const char string,
size_t  nmatch,
llvm_regmatch_t  pmatch[],
int  eflags 
)