Add Position-independent Code model Module API.
authorJustin Hibbits <jrh29@alumni.cwru.edu>
Fri, 7 Nov 2014 04:46:10 +0000 (04:46 +0000)
committerJustin Hibbits <jrh29@alumni.cwru.edu>
Fri, 7 Nov 2014 04:46:10 +0000 (04:46 +0000)
commit893f22f88245d29487e1fff662ac9e78f86f8e91
tree55804886279bc8ab8c08cff0875413d27734c6bb
parent75da31ff156af209b040d14f04ed92f9cc38ba3f
Add Position-independent Code model Module API.

Summary:
This makes PIC levels a Module flag attribute, which can be queried by the
backend.  The flag is named `PIC Level`, and can have a value of:

  0 - Backend-default
  1 - Small-model (-fpic)
  2 - Large-model (-fPIC)

These match the `-pic-level' command line argument for clang, and the value of the
preprocessor macro `__PIC__'.

Test Plan:
New flags tests specific for the 'PIC Level' module flag.
Tests to be added as part of a future commit for PowerPC, which will use this new API.

Reviewers: rafael, echristo

Reviewed By: rafael, echristo

Subscribers: rafael, llvm-commits

Differential Revision: http://reviews.llvm.org/D5882

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221510 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Module.h
include/llvm/Support/CodeGen.h
lib/IR/Module.cpp
test/Linker/Inputs/module-flags-pic-1-b.ll [new file with mode: 0644]
test/Linker/Inputs/module-flags-pic-2-b.ll [new file with mode: 0644]
test/Linker/module-flags-pic-1-a.ll [new file with mode: 0644]
test/Linker/module-flags-pic-2-a.ll [new file with mode: 0644]