diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-10 19:03:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-10 19:03:04 +0000 |
commit | 797c3c4f5dc4fda735e55c6b5d6270a54cf6d263 (patch) | |
tree | 3dc2c7a7c4e6f0a512404fe7449db442d5340a09 /tools/index-test | |
parent | 2e0110e5fa220eeb3a8a9836f69f6be05bd72f04 (diff) |
fix a couple of problems with section attributes:
1. Passing something that isn't a string used to cause:
"argument to annotate attribute was not a string literal"
make it say "section attribute" instead.
2. Fix the location of the above message to point to the
bad argument instead of the section token.
3. Implement rdar://4341926, by diagnosing invalid section
specifiers in the frontend rather than letting them slip all
the way to the assembler (a QoI win).
An example of #3 is that we used to produce something like this:
/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Expected comma after segment-name
/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Rest of line ignored. 1st junk character valued 46 (.).
Daniel improved clang to use llvm_report_error, so now we got:
$ clang t.c -c
fatal error: error in backend: Global variable 'x' has an invalid section specifier 'sadf': mach-o section specifier
requires a segment and section separated by a comma.
with no loc info. Now we get:
$ clang t.c -fsyntax-only
t.c:4:30: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment
and section separated by a comma
int x __attribute__((section("sadf")));
^
which is nice :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/index-test')
-rw-r--r-- | tools/index-test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tools/index-test/Makefile | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/tools/index-test/CMakeLists.txt b/tools/index-test/CMakeLists.txt index 880539bbe3..9c9656a113 100644 --- a/tools/index-test/CMakeLists.txt +++ b/tools/index-test/CMakeLists.txt @@ -11,6 +11,7 @@ set( LLVM_USED_LIBS set( LLVM_LINK_COMPONENTS bitreader + mc ) add_clang_executable(index-test diff --git a/tools/index-test/Makefile b/tools/index-test/Makefile index cec0eee286..0a43d2f47f 100644 --- a/tools/index-test/Makefile +++ b/tools/index-test/Makefile @@ -17,7 +17,7 @@ TOOL_NO_EXPORTS = 1 include $(LEVEL)/Makefile.config -LINK_COMPONENTS := bitreader +LINK_COMPONENTS := bitreader mc USEDLIBS = clangIndex.a clangFrontend.a clangSema.a clangAST.a clangLex.a clangBasic.a include $(LLVM_SRC_ROOT)/Makefile.rules |