[llvm-commits] CVS: llvm/include/Support/Alloca.h

Brian Gaeke gaeke at cs.uiuc.edu
Mon Jun 16 16:55:01 PDT 2003


Changes in directory llvm/include/Support:

Alloca.h added (r1.1)

---
Log message:

Isolate machine-dependent use of <alloca.h> in "Support/Alloca.h",
so that we can easily change its use to be conditional on the result of
an autoconf test later.


---
Diffs of the changes:

Index: llvm/include/Support/Alloca.h
diff -c /dev/null llvm/include/Support/Alloca.h:1.1
*** /dev/null	Mon Jun 16 16:54:06 2003
--- llvm/include/Support/Alloca.h	Mon Jun 16 16:53:55 2003
***************
*** 0 ****
--- 1,30 ----
+ //===-- include/Support/Alloca.h - Support for alloca header -----*- C++ -*--=//
+ //
+ // Some platforms do not have alloca.h; others do. You can include this
+ // file instead of <alloca.h> and it will include <alloca.h> on the platforms
+ // that require you to do so to use alloca().
+ //
+ //===----------------------------------------------------------------------===//
+ 
+ #ifndef LLVM_SUPPORT_ALLOCA_H
+ #define LLVM_SUPPORT_ALLOCA_H
+ 
+ // TODO: Determine HAVE_ALLOCA_H based on autoconf results.
+ // The following method is too brittle.
+ #if defined(HAVE_ALLOCA_H)
+ #undef HAVE_ALLOCA_H
+ #endif
+ 
+ #if defined(__linux__)
+ #define HAVE_ALLOCA_H 1
+ #elif defined(__sparc__)
+ #define HAVE_ALLOCA_H 1
+ #elif defined(__FreeBSD__)
+ // not defined here
+ #endif
+ 
+ #if HAVE_ALLOCA_H
+ #include <alloca.h>
+ #endif
+ 
+ #endif  /* LLVM_SUPPORT_ALLOCA_H */





More information about the llvm-commits mailing list